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

Improve design of export module interface #637

Open
jeancochrane opened this issue Nov 7, 2024 · 0 comments
Open

Improve design of export module interface #637

jeancochrane opened this issue Nov 7, 2024 · 0 comments
Assignees

Comments

@jeancochrane
Copy link
Contributor

In #626 we split up the export_models() function in dbt/scripts/utils/export.py to support a new requirement that the export_qc_town_close script filter the result set of each model query differently. The design works, but it's a bit clunky, and I imagine it'll be hard to extend. Dan suggests an iterative improvement:

Kind of a bizarre idea, but maybe something like:

  • Have a query for each model
  • Have a filter for each model

Create a unique set of all the query values across models, run them, then populate the models using the results (and apply the filter to each one).

Might be more complicated? Maybe save it for the next incremental improvement.

I think this is probably a better direction for the export model to go overall. It also strikes me that the save_model_to_workbook function logic could be owned by the ModelForExport class, since it mostly depends on attributes of that class. Similarly, I think a potential query/filter interface might make sense to move onto the ModelForExport object too.

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

No branches or pull requests

1 participant