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

import-db: support importing a table #10219

Merged
merged 2 commits into from
Jan 5, 2024
Merged

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Jan 4, 2024

I have also made import-db command visible in the help message and hidden the dbt-specific options.

$ dvc import-db --table customer --conn pgsql

(Note that I haven't added support for downloading a table with dbt's connection profile).

@skshetry skshetry requested a review from dberenbaum January 4, 2024 06:43
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (d218b6a) 90.50% compared to head (736b66f) 90.47%.
Report is 3 commits behind head on main.

Files Patch % Lines
dvc/commands/imp_db.py 37.50% 15 Missing ⚠️
dvc/dependency/db.py 80.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10219      +/-   ##
==========================================
- Coverage   90.50%   90.47%   -0.03%     
==========================================
  Files         499      499              
  Lines       37982    38042      +60     
  Branches     5518     5530      +12     
==========================================
+ Hits        34375    34419      +44     
- Misses       2965     2980      +15     
- Partials      642      643       +1     

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

@dberenbaum
Copy link
Collaborator

Could be a separate PR, but should we drop the dbt part at this point?

raise argparse.ArgumentTypeError("Either of --sql or --model is required.")
from dvc.exceptions import InvalidArgumentError

if self.args.table or self.args.sql:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are one of these required?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes they are required, and are mutually exclusive.

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

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

LGTM but what do you think about dropping the dbt stuff at this point? Seems like it would be useful to document how you could connect your dbt etl to your dvc pipeline, but I don't see much benefit in keeping the dbt-based implementation here.

@skshetry
Copy link
Member Author

skshetry commented Jan 5, 2024

LGTM but what do you think about dropping the dbt stuff at this point? Seems like it would be useful to document how you could connect your dbt etl to your dvc pipeline, but I don't see much benefit in keeping the dbt-based implementation here.

I was thinking of dropping in the next release, but we could do it now. Will create a separate PR.

@skshetry skshetry merged commit 0100c14 into iterative:main Jan 5, 2024
24 checks passed
@skshetry skshetry deleted the import-db-table branch January 5, 2024 03:41
BradyJ27 pushed a commit to BradyJ27/dvc that referenced this pull request Apr 22, 2024
* import-db: support importing a table

* unhide the import-db command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants