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: Fix test connection for extra fields #15645

Merged
merged 4 commits into from Jul 13, 2021
Merged

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Jul 12, 2021

SUMMARY

Allowing extra_json to be serialized into extra before trying to connect to DB from sqla form

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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 Jul 12, 2021

Codecov Report

Merging #15645 (a062430) into master (517f8c0) will decrease coverage by 0.14%.
The diff coverage is 14.28%.

❗ Current head a062430 differs from pull request most recent head 500c10b. Consider uploading reports for the commit 500c10b to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15645      +/-   ##
==========================================
- Coverage   76.91%   76.76%   -0.15%     
==========================================
  Files         978      978              
  Lines       51486    51487       +1     
  Branches     6950     6950              
==========================================
- Hits        39601    39525      -76     
- Misses      11661    11738      +77     
  Partials      224      224              
Flag Coverage Δ
hive ?
javascript 71.52% <14.28%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...c/views/CRUD/data/database/DatabaseModal/index.tsx 47.57% <14.28%> (+0.15%) ⬆️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.44% <0.00%> (-17.07%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-1.06%) ⬇️
superset/db_engine_specs/base.py 88.16% <0.00%> (-0.40%) ⬇️
superset/connectors/sqla/models.py 88.26% <0.00%> (-0.24%) ⬇️
superset/utils/core.py 88.77% <0.00%> (-0.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 517f8c0...500c10b. Read the comment docs.

@@ -384,11 +393,13 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
return;
}

console.log(db);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console statement

engine_params: JSON.parse((extraJson?.engine_params as string) || '{}'),
schemas_allowed_for_csv_upload:
(extraJson?.schemas_allowed_for_csv_upload as string) || '[]',
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this something that we can handle in the db reducer so that we can keep the state in the reducer as close to the state that the api requires?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we tried this intially but would get error everytime the user would have a misformatted JSON. So we broke it out to seperate field then onCreate or testConn we'd serialize and create the request.

@hughhhh hughhhh merged commit 2dc8bd6 into master Jul 13, 2021
@rosemarie-chiu
Copy link
Contributor

🏷 2021.27

henryyeh pushed a commit to preset-io/superset that referenced this pull request Jul 13, 2021
* create serialize json function

* remove console.log

* use function

(cherry picked from commit 2dc8bd6)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* create serialize json function

* remove console.log

* use function
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* create serialize json function

* remove console.log

* use function
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* create serialize json function

* remove console.log

* use function
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
@mistercrunch mistercrunch deleted the fix-test-connection-extra branch March 26, 2024 16:12
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:2021.27 size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants