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

feat: Move SQLAlchemy url reference to config #13182

Merged
merged 9 commits into from
Feb 18, 2021
Merged

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Feb 17, 2021

SUMMARY

Giving the ability for us at preset, to set the value for the sqlalchemy doc when running in our env

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@pull-request-size pull-request-size bot added size/M and removed size/S labels Feb 17, 2021
const DEFAULT_TAB_KEY = '1';
const DEFAULT_SQLALCHEMY_DOCS_URL =
'https://docs.sqlalchemy.org/en/rel_1_2/core/engines.html#';
Copy link
Member

Choose a reason for hiding this comment

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

do you want to put this in the default config file instead?

Copy link
Member

Choose a reason for hiding this comment

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

Actually I see you also have it there.. seems like unless someone overwrites it with an empty string in their own config, it should always exist and we shouldn't need a default here as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default i'm using since the unit test aren't playing nice, i couldn't figure out how to get the wrappingComponent must render its children!

@@ -132,6 +145,10 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const [db, setDB] = useState<DatabaseObject | null>(null);
const [isHidden, setIsHidden] = useState<boolean>(true);
const [tabKey, setTabKey] = useState<string>(DEFAULT_TAB_KEY);
const conf = useSelector((state: RootState) => {
console.log(state);
Copy link
Member

Choose a reason for hiding this comment

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

console.log

@@ -1092,6 +1092,9 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
# It will get executed each time when user open a chart's explore view.
DATASET_HEALTH_CHECK = None

# SQLAlchema link doc reference
Copy link
Member

Choose a reason for hiding this comment

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

typo

@@ -402,7 +419,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
<div className="helper">
{t('Refer to the ')}
<a
href="https://docs.sqlalchemy.org/en/rel_1_2/core/engines.html#"
href={conf?.SQLALCHEMY_DOCS_URL ?? DEFAULT_SQLALCHEMY_DOCS_URL}
Copy link
Member

Choose a reason for hiding this comment

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

per above, it seems that just conf.SQLALCHEMY_DOCS_URL should always have a value.

Copy link
Member

Choose a reason for hiding this comment

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

do we want to also update the string text below?

Copy link
Member Author

Choose a reason for hiding this comment

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

what string text are your referencing?

Copy link
Member

Choose a reason for hiding this comment

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

the text for the link. "refer to the sqlalchemy docs...". It's in the ticket, too.

@@ -1092,6 +1092,9 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
# It will get executed each time when user open a chart's explore view.
DATASET_HEALTH_CHECK = None

# SQLAlchema link doc reference
SQLALCHEMY_DOCS_URL = "https://docs.sqlalchemy.org/en/rel_1_2/core/engines.html#"
Copy link
Member

Choose a reason for hiding this comment

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

tiny tiny nit, but prob don't need the # at the end.
I suppose we should also update the link to https://docs.sqlalchemy.org/en/13/core/engines.html since we're on 1.3 now.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

small nits

@codecov-io
Copy link

codecov-io commented Feb 17, 2021

Codecov Report

Merging #13182 (6545601) into master (2ce7982) will increase coverage by 11.94%.
The diff coverage is 48.72%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #13182       +/-   ##
===========================================
+ Coverage   53.06%   65.00%   +11.94%     
===========================================
  Files         489     1043      +554     
  Lines       17314    49394    +32080     
  Branches     4482     5338      +856     
===========================================
+ Hits         9187    32109    +22922     
- Misses       8127    17069     +8942     
- Partials        0      216      +216     
Flag Coverage Δ
cypress ?
javascript 62.38% <46.40%> (?)
python 66.83% <51.45%> (?)

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

Impacted Files Coverage Δ
...end/src/SqlLab/components/RunQueryActionButton.tsx 64.28% <ø> (+11.50%) ⬆️
superset-frontend/src/chart/ChartContainer.jsx 100.00% <ø> (ø)
superset-frontend/src/chart/ChartRenderer.jsx 39.18% <0.00%> (-37.53%) ⬇️
...perset-frontend/src/common/components/Dropdown.tsx 54.76% <ø> (+4.76%) ⬆️
...ontend/src/components/ListViewCard/ImageLoader.tsx 86.36% <0.00%> (+11.36%) ⬆️
...set-frontend/src/components/URLShortLinkButton.jsx 100.00% <ø> (ø)
.../src/components/dataViewCommon/TableCollection.tsx 100.00% <ø> (+2.12%) ⬆️
...et-frontend/src/dashboard/actions/sliceEntities.js 12.90% <ø> (-58.07%) ⬇️
...src/dashboard/components/HeaderActionsDropdown.jsx 54.79% <ø> (-12.78%) ⬇️
...end/src/dashboard/components/StickyVerticalBar.tsx 50.00% <ø> (-50.00%) ⬇️
... and 1050 more

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 6e09156...6545601. Read the comment docs.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Awesome!

@@ -1092,6 +1092,9 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
# It will get executed each time when user open a chart's explore view.
DATASET_HEALTH_CHECK = None

# SQLalchemy link doc reference
SQLALCHEMY_DOCS_URL = "https://docs.sqlalchemy.org/en/13/core/engines.html"
Copy link
Member

Choose a reason for hiding this comment

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

Noice!

@hughhhh hughhhh closed this Feb 18, 2021
@hughhhh hughhhh reopened this Feb 18, 2021
@hughhhh hughhhh merged commit 3c58fc5 into master Feb 18, 2021
@hughhhh hughhhh deleted the hugh/sqlalchemy-docs-2 branch February 18, 2021 17:42
henryyeh pushed a commit to preset-io/superset that referenced this pull request Mar 4, 2021
Manual conflict resolution

(cherry picked from commit 3c58fc5)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 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 size/M 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants