You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python Models use context.resolve_table(model_name) to find the physical table name to query.
When unittesting a python model with data fixtures mocking upstream tables, resolve_table does not resolve to the mocked fixture, IF the upstream table is not a SQLMesh model.
the table_ref field will resolve to "catalog.schema.upstream_table_not_a_model", and NOT the table generated by the unittest yml.
This makes unittesting Python models dependent on upstream tables, which are NOT sqlmesh models, impossible.
Either, context.resolve_table should resolve to the table created by the data fixture, or fetchdf should parse and replace the table reference to point to the data fixture.
The text was updated successfully, but these errors were encountered:
Python Models use
context.resolve_table(model_name)
to find the physical table name to query.When unittesting a python model with data fixtures mocking upstream tables,
resolve_table
does not resolve to the mocked fixture, IF the upstream table is not a SQLMesh model.For example, with a model such as:
and a unittest yml of:
the
table_ref
field will resolve to "catalog.schema.upstream_table_not_a_model", and NOT the table generated by the unittest yml.This makes unittesting Python models dependent on upstream tables, which are NOT sqlmesh models, impossible.
Either, context.resolve_table should resolve to the table created by the data fixture, or fetchdf should parse and replace the table reference to point to the data fixture.
The text was updated successfully, but these errors were encountered: