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

[CT-2236] [Feature] Remove lib.py [as much as possible] #7093

Closed
3 tasks done
Tracked by #7162 ...
ChenyuLInx opened this issue Feb 28, 2023 · 3 comments · Fixed by #7270
Closed
3 tasks done
Tracked by #7162 ...

[CT-2236] [Feature] Remove lib.py [as much as possible] #7093

ChenyuLInx opened this issue Feb 28, 2023 · 3 comments · Fixed by #7270
Assignees
Labels
enhancement New feature or request python_api Issues related to dbtRunner Python entry point

Comments

@ChenyuLInx
Copy link
Contributor

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

Remove current lib.py

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

@ChenyuLInx ChenyuLInx added enhancement New feature or request triage Refinement Maintainer input needed labels Feb 28, 2023
@github-actions github-actions bot changed the title [Feature] remove lib.py [CT-2236] [Feature] remove lib.py Feb 28, 2023
@dbeatty10 dbeatty10 removed the triage label Feb 28, 2023
@jtcohen6 jtcohen6 added python_api Issues related to dbtRunner Python entry point Team:Execution labels Feb 28, 2023
@ChenyuLInx
Copy link
Contributor Author

ChenyuLInx commented Mar 7, 2023

In dbt-server, there are currently the following use cases of lib.py

  1. create a RuntimeConfig to reuse
    • this is always paired with 2 or 3
  2. create a Manifest python object from an existing manifest.msgpack on disk, to reuse
    • this use case is only needed for SL worker initialization
  3. create a Manifest python object from project file
  4. serialize a Manifest python object, this is to save things to different locations.
    • saving things to different locations is for use case 2 listed above, and partial parsing
    • we already save a manifest.msgpack for partial parsing to a location here

In #6547 , we can add the following functions:

  • return a Manifest python object in result
  • return a RuntimeConfig(Doesn't have to RuntimeConfig, and we shouldn't guarantee any interface on this object.)
  • return the partial parsing file write location
    This can fulfill the use case 1, 3, 4 above, 4 is fulfilled here given that is the location of a file is returned, dbt-server can implement logic to duplicate that file to other locations if needed.

Then what's left are use case 1, 2 combination. This use case is only for SL dbt-server initialization.(@racheldaniel correct me if I am wrong but compile query is the only operation in dbt-server that doesn't access local files at all, preview actually still read local files) We are a bit unclear on whether we need this function in dbt-server in the future, but leaning towards not needed side. And the timing for it is unclear
In the mean time, to make sure dbt-core 1.5 release smoothly, we have the following options

  • Add a new code path in parse to skip read project files, just construct RuntimeConfig, read a manifest.msgpack into python object, and return them?
  • create a new command load(?) hidden from CLI user, but available via dbtRunner, to do the above mentioned work
  • leave function deserialize_manifest and get_dbt_config as is in lib.py, remove in later releases when we no longer need them.

I am leaning towards the last option here for now. It leave something in lib.py, but we should have a clear path on removing it if SL layer use case is no longer needed in dbt-server. And we can pivot to one of the first two if needed.

Thoughts? Any background/context that feels missing? @jtcohen6 @racheldaniel @aranke @stu-k

@aranke
Copy link
Member

aranke commented Mar 7, 2023

Let's take a step back and think about what interfaces are required here?
Currently, we're thinking too much about implementations, but we should get away from that.

@jtcohen6
Copy link
Contributor

jtcohen6 commented Mar 13, 2023

Let's leave these two functions in lib.py for v1.5:

  • deserialize_manifest
  • get_dbt_config

This is our way of saying, We're not determining the interfaces here until later. In the meantime, we'll continue to own the current implementation.

The acceptance criterion for this ticket is deleting all other methods from lib.py.

@jtcohen6 jtcohen6 removed the Refinement Maintainer input needed label Mar 13, 2023
@jtcohen6 jtcohen6 changed the title [CT-2236] [Feature] remove lib.py [CT-2236] [Feature] Remove lib.py [as much as possible] Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python_api Issues related to dbtRunner Python entry point
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants