Replies: 3 comments
-
This will benefit the use cases where we want to use the tables for modeling without adding them into the source.yml manually (or via codegen), enabling more self-service possibilities. |
Beta Was this translation helpful? Give feedback.
-
For our particular case (Materialize), it isn't possible to know what tables will be created without pinging the upstream database, or waiting for the It's unfortunate that specifying a wildcard for |
Beta Was this translation helpful? Give feedback.
-
FYI, a potential follow-up is discussed at #7145 |
Beta Was this translation helpful? Give feedback.
-
See also: #6067, #6104 (comment), #5103
Proposal
Adapted from #6067 (comment):
Is there merit in the idea of a single "dynamic" source? Normally, dbt will validate that the
source()
you're asking for is actually one you've defined in your yaml files. (It actually doesn't validate that the table really exists in the database—again, because DAG nodes are defined independent on database state—a very good thing.) What if you could tell dbt, "Don't worry about this one?"dbt would accept the second argument as the name of a table, and trust you that it exists:
Say you have another model, too:
In the DAG viz, you'd just see that both models depend on
my_dynamic_source.*
:Questions
Are we opening ourselves up for bad habits, whereby it's so easy to specify
source.*
that users never specify more-specific tables?I don't think that's guaranteed to happen. By specifying specific source tables, you still get the abilities to:
source freshness
Really, this capability would solve for cases where the alternative is not using a source at all. And that's no worse.
What the heck will
docs generate
do, to generate a catalog for this table? Should we just try fetching metadata on the schema instead? This would require some lightweight development work indbt-docs
to feel copacetic.Should it be possible to define specific source tables and flexibly reference additional ones? Should
*
be the default catch-all whenever there's a{{ source(..., ...) }}
call to a source table not-yet-defined? (If we move in this direction, it's another good reason to maintain the clear distinction betweensource()
andref()
, a la the proposal in #5910.)Beta Was this translation helpful? Give feedback.
All reactions