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(db_engine_specs): added support for Denodo Virtual DataPort #29927

Merged

Conversation

denodo-research-labs
Copy link
Contributor

SUMMARY

Following up on #20656, this PR adds basic support for connecting to Denodo Virtual DataPort (aka VDP Server) from Superset.

This includes:

  • A Denodo DB Engine Spec (in superset/db_engine_specs/denodo.py).
  • Version configuration for the companion SQLAlchemy dialect (in pyproject.toml).
  • Changes to the documentation in order to mention the new support (in docs/docs/configuration/databases.mdx).

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

@github-actions github-actions bot added the doc Namespace | Anything related to documentation label Aug 13, 2024
@dosubot dosubot bot added data:connect Namespace | Anything related to db connections / integrations enhancement:db Suggest new DB connections labels Aug 13, 2024
Copy link

codecov bot commented Aug 13, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.91%. Comparing base (76d897e) to head (267dbfd).
Report is 883 commits behind head on master.

Files with missing lines Patch % Lines
superset/db_engine_specs/denodo.py 86.66% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29927       +/-   ##
===========================================
+ Coverage   60.48%   83.91%   +23.42%     
===========================================
  Files        1931      534     -1397     
  Lines       76236    38728    -37508     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32499    -13615     
+ Misses      28017     6229    -21788     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.94% <68.88%> (-0.23%) ⬇️
javascript ?
mysql 76.76% <68.88%> (?)
postgres 76.86% <68.88%> (?)
presto 53.40% <68.88%> (-0.40%) ⬇️
python 83.91% <86.66%> (+20.42%) ⬆️
sqlite 76.31% <68.88%> (?)
unit 60.90% <86.66%> (+3.27%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas
Copy link
Member

Feel free to add the logo, too! They can appear on the website and readme.

You can also test compatibility and add it to this automated report:
https://github.com/apache/superset/blob/master/superset/db_engine_specs/README.md

@betodealmeida might be able to provide a tiny bit of guidance on the latter.

@denodo-research-labs
Copy link
Contributor Author

As @michael-s-molina commented on #29927 that new features can only be accepted for 4.1, we are focusing on this PR. We've just added a couple of changes to the db_engine_spec in order to fine-tune timestamp handling and resolve most of the items the pylint was complaining about.

Feel free to add the logo, too! They can appear on the website and readme.

Will do. Is there a specific order to be followed for adding logos? It's not alphabetic...

You can also test compatibility and add it to this automated report:
https://github.com/apache/superset/blob/master/superset/db_engine_specs/README.md

@betodealmeida might be able to provide a tiny bit of guidance on the latter.

Yes please, any hints on how to do this would be useful.

@michael-s-molina
Copy link
Member

michael-s-molina commented Aug 14, 2024

As @michael-s-molina commented on #29927 that new features can only be accepted for 4.1, we are focusing on this PR.

@denodo-research-labs Ideally, you would only merge this to master and let the release manager determine in which minor version this should be included. For 4.1, the release manager is @sadpandajoe.

@michael-s-molina
Copy link
Member

michael-s-molina commented Aug 14, 2024

@denodo-research-labs If you wish to know more details about our release process you can check https://github.com/apache/superset/wiki/Release-Process

@denodo-research-labs
Copy link
Contributor Author

@betodealmeida Any guidance on how to perform the compatibility tests and updating the automated report in https://github.com/apache/superset/blob/master/superset/db_engine_specs/README.md? Are we meant to execute superset db-test <URI> and then manually update the README file with its output, or is there any kind of automated way of doing this?

@rusackas rusackas requested a review from betodealmeida August 22, 2024 05:17
@denodo-research-labs
Copy link
Contributor Author

Just checking: anything else needed from our side? Are those modifications on superset/db_engine_specs/README.md a requirement? If so, any guidance on how to perform them?

@denodo-research-labs
Copy link
Contributor Author

We are trying to make plans regarding Superset support in some of our components: is there any possibility that this gets included in 4.1?

@villebro
Copy link
Member

villebro commented Oct 7, 2024

@denodo-research-labs this PR has a conflict against master branch. So at minimum, it will need to be rebased. Ideally, you should also add unit tests under tests/unit_tests/db_engine_specs (you can look at the existing tests for examples)

@denodo-research-labs denodo-research-labs force-pushed the denodo/master/db_engine_spec branch from dfb3706 to 0c8bb48 Compare October 7, 2024 17:25
@denodo-research-labs denodo-research-labs force-pushed the denodo/master/db_engine_spec branch from b9be57e to 953013d Compare October 9, 2024 13:42
@denodo-research-labs
Copy link
Contributor Author

@villebro PR rebased on master, added unit tests.

@betodealmeida
Copy link
Member

@betodealmeida Any guidance on how to perform the compatibility tests and updating the automated report in https://github.com/apache/superset/blob/master/superset/db_engine_specs/README.md? Are we meant to execute superset db-test <URI> and then manually update the README file with its output, or is there any kind of automated way of doing this?

Running python superset/db_engine_specs/lib.py will update the table (you need to manually add the output to the README file), but we can do that later as well.

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.

This is great!

@@ -119,6 +119,7 @@ databricks = [
"sqlalchemy-databricks>=0.2.0",
]
db2 = ["ibm-db-sa>0.3.8, <=0.4.0"]
denodo = ["denodo-sqlalchemy~=1.0.6"]
Copy link
Member

Choose a reason for hiding this comment

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

Ah, TIL about ~=!



# Internal class for defining error message patterns (for translation)
class _ErrorPatterns:
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@denodo-research-labs
Copy link
Contributor Author

Just added a new commit to make the automated PR code checks happier: replaced == None with is None in the unit test.

@denodo-research-labs
Copy link
Contributor Author

Any chance this PR can get the review it still needs before 4.1 is out? This affects our plans for the integration of Apache Superset with some parts of our software, so if by now it is clear that this integration won't happen for 4.1, it would be great to know as soon as possible in order to remake our plans accordingly.

@villebro
Copy link
Member

@denodo-research-labs please check CI results: a required lint check is still failing:
image

Other than that it looks good to go.

@denodo-research-labs
Copy link
Contributor Author

Thanks @villebro

Isn't this the error that is being reported by the linter?

 ************* Module superset.db_engine_specs.denodo
superset/db_engine_specs/denodo.py:28:0: R0903: Too few public methods (0/2) (too-few-public-methods)

But there's not much that can be done about that in an implementation of a DB Engine Spec... it is basically a class only overwriting those attributes / methods that need to be overwritten. Perhaps we are missing anything else here?

@michael-s-molina
Copy link
Member

@denodo-research-labs you can add # pylint: disable=too-few-public-methods to the _ErrorPatterns class.

@villebro
Copy link
Member

Any chance this PR can get the review it still needs before 4.1 is out? This affects our plans for the integration of Apache Superset with some parts of our software, so if by now it is clear that this integration won't happen for 4.1, it would be great to know as soon as possible in order to remake our plans accordingly.

@denodo-research-labs as this is a new feature, I suspect it won't make it into 4.1 anymore, as the cut for this release has already been made (generally only bugfixes get cherried into the release after the cut). But let's try to get this merged asap so it doesn't miss the 5.0 cut.

@denodo-research-labs
Copy link
Contributor Author

OK, now unless we've broken something :) both pylint and ruff should be happy. We added the pylint disable flag, and let ruff check and format the code.

@denodo-research-labs as this is a new feature, I suspect it won't make it into 4.1 anymore, as the cut for this release has already been made (generally only bugfixes get cherried into the release after the cut). But let's try to get this merged asap so it doesn't miss the 5.0 cut.

Thanks for the info @villebro. Is there a planned date for 5.0 already?

@villebro
Copy link
Member

@denodo-research-labs you can check the release process here: https://github.com/apache/superset/wiki/Release-Process . Work for 5.0 should start soon after 4.1 is out.

@villebro
Copy link
Member

It seems there's still some linting issues. I recommend setting up pre-commit hooks, as they'll automatically take care of simple linting issues like those in this PR: https://superset.apache.org/docs/contributing/development/#git-hooks

@denodo-research-labs
Copy link
Contributor Author

We did that, but everything looks fine on our end:

$ git status
On branch denodo/master/db_engine_spec
Your branch is up to date with 'origin/denodo/master/db_engine_spec'.

$ pre-commit run --files superset/db_engine_specs/denodo.py
auto-walrus..............................................................Passed
mypy.....................................................................Passed
pip-compile-multi verify.............................(no files to check)Skipped
check docstring is first.................................................Passed
check for added large files..............................................Passed
check yaml...........................................(no files to check)Skipped
debug statements (python)................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
prettier.............................................(no files to check)Skipped
Blacklist................................................................Passed
Helm Docs............................................(no files to check)Skipped
ruff.....................................................................Passed
ruff-format..............................................................Passed
pylint...................................................................Passed

Unfortunately the GitHub task does not give much info, only that ruff is still not happy:

ruff.....................................................................Failed
- hook id: ruff
- files were modified by this hook

Found 1 error (1 fixed, 0 remaining).

ruff-format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook

2 files reformatted, 1427 files left unchanged

pylint...................................................................Passed

But ruff says everything is alright:

$ ruff check superset/db_engine_specs/denodo.py
All checks passed!

Any pointers on how to find out what is happening? ruff version is 0.7.1, pylint 3.3.1

@denodo-research-labs
Copy link
Contributor Author

denodo-research-labs commented Oct 24, 2024

@villebro found it, our fault. We were only focusing on ruff liking the denodo.py file, but what it was actually complaining about was that it needed to reformat 1 line of code in the unit test test_denodo.py.

Now pre-install runs for us with --all-files:

$ pre-commit run --all-files
auto-walrus..............................................................Passed
mypy.....................................................................Passed
pip-compile-multi verify.................................................Passed
check docstring is first.................................................Passed
check for added large files..............................................Passed
check yaml...............................................................Passed
debug statements (python)................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
prettier.................................................................Passed
Blacklist................................................................Passed
Helm Docs................................................................Passed
ruff.....................................................................Passed
ruff-format..............................................................Passed
pylint...................................................................Passed

Sorry for all the fuss.

@villebro villebro merged commit 1c56857 into apache:master Oct 24, 2024
38 of 39 checks passed
@denodo-research-labs
Copy link
Contributor Author

Great to see this merged. Thanks for all the help @villebro @michael-s-molina @betodealmeida @rusackas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:connect Namespace | Anything related to db connections / integrations doc Namespace | Anything related to documentation enhancement:db Suggest new DB connections size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants