-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
chore: remove get_columns_description duplication #24819
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24819 +/- ##
==========================================
+ Coverage 68.84% 68.96% +0.12%
==========================================
Files 1902 1903 +1
Lines 73997 73996 -1
Branches 8195 8193 -2
==========================================
+ Hits 50944 51034 +90
+ Misses 20934 20846 -88
+ Partials 2119 2116 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 8 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
try: | ||
with dataset.database.get_raw_connection(schema=dataset.schema) as conn: | ||
cursor = conn.cursor() | ||
query = dataset.database.apply_limit_to_sql(statements[0], limit=1) | ||
db_engine_spec.execute(cursor, query) | ||
result = db_engine_spec.fetch_data(cursor, limit=1) | ||
result_set = SupersetResultSet(result, cursor.description, db_engine_spec) | ||
cols = result_set.columns | ||
except Exception as ex: | ||
raise SupersetGenericDBErrorException(message=str(ex)) from ex | ||
return cols |
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.
This is almost identical to get_columns_description
, the only difference is the schema passed to the connection.
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.
Thanks for the cleanup.
SUMMARY
Small refactoring removing duplicate logic.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION