-
Notifications
You must be signed in to change notification settings - Fork 16.6k
fix(sqla): labels_expected contains mutated label #14095
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(sqla): labels_expected contains mutated label #14095
Conversation
dpgaspar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice catch, just a comment on the test
Codecov Report
@@ Coverage Diff @@
## master #14095 +/- ##
==========================================
+ Coverage 79.52% 79.71% +0.18%
==========================================
Files 939 942 +3
Lines 47541 47676 +135
Branches 5938 5984 +46
==========================================
+ Hits 37808 38004 +196
+ Misses 9612 9551 -61
Partials 121 121
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
SUMMARY
The recent PR #13739 caused a regression causing mutated column aliases to be returned from the SQLAlchemy model in the resulting
DataFrame. The bug affects datasets on BigQuery, Athena, Redshift and Elasticsearch/Open Distro. By setting the optionalkeyparameter on theColumnobject (docs) to the expected column name, and later referencing that when renaming columns in theDataFrame, we can ensure that column names are mutated back prior to returning.BEFORE
Currently column names containing restricted characters are returned. See the failed query and the column

COUNT_DISTINCT(str)calledCOUNT_DISTINCT__93439in the Results tab):AFTER
After the change, the chart renders and the column names in the Results tab show the expected labels:

TEST PLAN
CI + new test
ADDITIONAL INFORMATION