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

filter: Replace backtick quoting in Pandas query #1417

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Feb 15, 2024

Description of proposed changes

ast.walk does not support the special case of backtick quoting that is supported by pandas.DataFrame.query, so it must be replaced for ast.walk then reversed to obtain the actual variable names.

Related issue(s)

Checklist

  • Checks pass
  • If making user-facing changes, add a message in CHANGES.md summarizing the changes in this PR

@victorlin victorlin self-assigned this Feb 15, 2024
@victorlin victorlin force-pushed the victorlin/fix-backtick-quoting-by-replacement branch 2 times, most recently from 7b200da to a66ec16 Compare February 16, 2024 01:27
@victorlin victorlin changed the base branch from master to victorlin/restore-reading-all-columns February 16, 2024 01:27
@victorlin victorlin force-pushed the victorlin/fix-backtick-quoting-by-replacement branch from a66ec16 to 7247039 Compare February 16, 2024 01:36
@victorlin victorlin force-pushed the victorlin/restore-reading-all-columns branch from a207276 to 4e4f0d2 Compare February 16, 2024 01:36
@victorlin victorlin marked this pull request as ready for review February 16, 2024 01:39
@victorlin victorlin requested a review from a team February 16, 2024 01:39
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (71015ed) 68.42% compared to head (b4e3a27) 68.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1417      +/-   ##
==========================================
+ Coverage   68.42%   68.50%   +0.07%     
==========================================
  Files          69       69              
  Lines        7519     7537      +18     
  Branches     1843     1846       +3     
==========================================
+ Hits         5145     5163      +18     
  Misses       2091     2091              
  Partials      283      283              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

augur/filter/include_exclude_rules.py Outdated Show resolved Hide resolved
augur/filter/include_exclude_rules.py Outdated Show resolved Hide resolved
Base automatically changed from victorlin/restore-reading-all-columns to master February 16, 2024 19:12
@victorlin victorlin force-pushed the victorlin/fix-backtick-quoting-by-replacement branch from 7247039 to 8d85ffb Compare February 16, 2024 19:49
ast.walk does not support the special case of backtick quoting that is
supported by pandas.DataFrame.query, so it must be replaced for ast.walk
then reversed to obtain the actual variable names.
@victorlin victorlin force-pushed the victorlin/fix-backtick-quoting-by-replacement branch from 8d85ffb to b4e3a27 Compare February 16, 2024 20:01
@victorlin victorlin merged commit 9141f59 into master Feb 16, 2024
20 checks passed
@victorlin victorlin deleted the victorlin/fix-backtick-quoting-by-replacement branch February 16, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filter: --query broken with backtick quoting
2 participants