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: BigQuery get_parameters_from_uri #20966

Merged
merged 2 commits into from
Aug 4, 2022

Conversation

betodealmeida
Copy link
Member

SUMMARY

Fix a bug in BigQuery probably introduced with the upgrade to SQLAlchemy 1.4. When building a URL with make_url, the query attribute is now an immutabledict, which fails to be serialized to JSON. I fixed the get_parameters_from_uri method in the BigQuery DB engine spec by explicitly converting it into a dictionary.

I also checked for other places where this could happen, but couldn't find any other place where we return the query attribute to be serialized to JSON.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

None.

TESTING INSTRUCTIONS

Added unit tests and confirmed that I was able to (1) add a BigQuery database (this was failing) and edit it later (also failing).

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #20966 (3c346c0) into master (e4fc556) will decrease coverage by 11.49%.
The diff coverage is 100.00%.

❗ Current head 3c346c0 differs from pull request most recent head 58b44ed. Consider uploading reports for the commit 58b44ed to get more accurate results

@@             Coverage Diff             @@
##           master   #20966       +/-   ##
===========================================
- Coverage   66.37%   54.88%   -11.50%     
===========================================
  Files        1767     1767               
  Lines       67230    67230               
  Branches     7137     7137               
===========================================
- Hits        44625    36898     -7727     
- Misses      20779    28506     +7727     
  Partials     1826     1826               
Flag Coverage Δ
hive 53.20% <0.00%> (ø)
mysql ?
postgres ?
presto 53.10% <0.00%> (ø)
python 57.84% <100.00%> (-23.73%) ⬇️
sqlite ?
unit 50.53% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engine_specs/bigquery.py 53.93% <100.00%> (-30.91%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-88.89%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-80.77%) ⬇️
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) ⬇️
superset/datasets/commands/update.py 25.00% <0.00%> (-69.05%) ⬇️
superset/datasets/commands/create.py 29.41% <0.00%> (-68.63%) ⬇️
superset/datasets/commands/importers/v0.py 24.03% <0.00%> (-67.45%) ⬇️
superset/views/datasource/utils.py 27.90% <0.00%> (-67.45%) ⬇️
... and 278 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@betodealmeida betodealmeida merged commit 7e501cd into apache:master Aug 4, 2022
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Aug 5, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2022.31 size/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants