-
Notifications
You must be signed in to change notification settings - Fork 398
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
Add source
attribute to dbt_task
and sql_task.file
tasks to support files from workspace
#3208
Conversation
…port files from workspace Also added support for it in TF exporter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added suggestions for docs and a few questions/requests to clarify what and why the code does what it does.
Is there test coverage for Import
the PR could extend? Logic like len(parts) >= 4
feel brittle and the assumptions could break about how a path looks like in the future.
Co-authored-by: Gabor Ratky <gabor.ratky@databricks.com>
Co-authored-by: Gabor Ratky <gabor.ratky@databricks.com>
Co-authored-by: Gabor Ratky <gabor.ratky@databricks.com>
Co-authored-by: Gabor Ratky <gabor.ratky@databricks.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3208 +/- ##
==========================================
+ Coverage 83.57% 83.75% +0.17%
==========================================
Files 168 170 +2
Lines 15021 15334 +313
==========================================
+ Hits 12554 12843 +289
- Misses 1729 1738 +9
- Partials 738 753 +15
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, have some questions, logic overall looks good.
@@ -240,6 +247,7 @@ func (ic *importContext) emitNotebookOrRepo(path string) { | |||
if strings.HasPrefix(path, "/Repos") { | |||
ic.emitRepoByPath(path) | |||
} else { | |||
// TODO: strip /Workspace prefix if it's provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Is this TODO not required currently? what happens if /Workspace prefix is provided?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's related to this issue: #3195 - we're introduced ability to refer to objects with /Workspace
and without, but notebooks/workspace files right now are using path without /Workspace
, so I just left a comment for myself to handle this case in the near future
Value: strings.Join(parts[:4], "/"), | ||
}) | ||
} else { | ||
log.Printf("[WARN] Incorrect Repos path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of warn, shouldn't we Fail here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, our APIs aren't strictly consistent, so it's possible to create jobs pointing to non-existing paths, clusters, etc., but we should tolerate that :-( Otherwise, a lot of exports will fail - it's easier to fix TF code sometimes than fix objects in the workspace
Changes
Also added support for it in TF exporter
Tests
make test
run locallydocs/
folderinternal/acceptance