dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.87k stars 1.63k forks source link

[Tech Debt] Improve unit testing and internal documentation on Contexts and providers #10942

Open MichelleArk opened 2 days ago

MichelleArk commented 2 days ago

The various jinja contexts are fairly well documented for users, but are very unstructured objects internally. Let's take a pass at ensuring our tests provide coverage to the documentation, improving our internal documentation around the Context and Provider design, and consider any refactors along the way.

### Testing
- [ ] https://github.com/dbt-labs/dbt-core/issues/10954
- [ ] https://github.com/dbt-labs/dbt-core/issues/10951
- [ ] https://github.com/dbt-labs/dbt-core/issues/10953
- [ ] https://github.com/dbt-labs/dbt-core/issues/10952
- [ ] unit test BaseContext methods / types in addition to existence of values
### Documentation
- [ ] Internal guides on current `Provider`, `Context` and `generate_` methods
### Refactors
- [ ] Consider removing `Providers` in favor of parse-time and execution-time contexts.
devmessias commented 1 day ago

I have submitted some PRs that fix issues in the unit tests, along with one suggestion. I was also working on resolving the naming collision problem when using sources. However, I’d like to wait for decisions on my previous issues and PRs before making a new PR. Would it be a good idea to put here these issues as technical debt to be addressed/reviewed?