Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix behavior of _ when searching for DAGs #27448

Merged
merged 3 commits into from Nov 1, 2022

Conversation

jedcunningham
Copy link
Member

On the homepage, when you search for DAGs, _ wasn't behaving as most people might expect since it is a single character wildcard in SQL. We will automatically escape it now.

On the homepage, when you search for DAGs, `_` wasn't behaving as most
people might expect since it is a single character wildcard in SQL. We
will automatically escape it now.
@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Nov 1, 2022
@ashb
Copy link
Member

ashb commented Nov 1, 2022

Hmmm, there's something built in to SQLA for this https://docs.sqlalchemy.org/en/14/orm/internals.html#sqlalchemy.orm.PropComparator.like.params.escape

Oh, it's for this:

To match a literal underscore or percent sign without matching other characters, the respective character in pattern must be preceded by the escape character. The default escape character is the backslash but a different one can be selected by using the ESCAPE clause. To match the escape character itself, write two escape characters.

airflow/www/views.py Outdated Show resolved Hide resolved
Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Nov 1, 2022
@jedcunningham jedcunningham added this to the Airflow 2.4.3 milestone Nov 1, 2022
@jedcunningham jedcunningham merged commit eda0893 into apache:main Nov 1, 2022
@jedcunningham jedcunningham deleted the fix_search branch November 1, 2022 23:55
ephraimbuddy pushed a commit that referenced this pull request Nov 9, 2022
On the homepage, when you search for DAGs, `_` wasn't behaving as most
people might expect since it is a single character wildcard in SQL. We
will automatically escape it now.

(cherry picked from commit eda0893)
ephraimbuddy pushed a commit that referenced this pull request Nov 9, 2022
On the homepage, when you search for DAGs, `_` wasn't behaving as most
people might expect since it is a single character wildcard in SQL. We
will automatically escape it now.

(cherry picked from commit eda0893)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:webserver Webserver related Issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants