Astronomer Cosmos Version
1.15.1. Regression from 1.15.0, introduced by #2879 (the fix for #2843).
dbt Core or Fusion version
dbt Core 1.11.11
Versions of dbt adapters
dbt-redshift 1.10.1
LoadMode
DBT_LS_MANIFEST
ExecutionMode
WATCHER
InvocationMode
SUBPROCESS
airflow version
3.2.1
Operating System
Amazon Linux
If a you think it's an UI issue, what browsers are you seeing the problem on?
No response
Deployment
Amazon (AWS) MWAA
Deployment details
No response
What happened?
Our profiles.yml uses dbt's documented profiles.yml filters on numeric fields, e.g.
threads: "{{ env_var('DBT_THREADS', 4) | as_number }}"
(as_number/as_bool are documented specifically for profiles.yml:
https://docs.getdbt.com/reference/dbt-jinja-functions/as_number. dbt parses and runs
this profile fine.)
After upgrading 1.15.0 → 1.15.1, a WATCHER DbtDag run completes fully green but emits
zero Assets/dataset events — for every model, not just affected fields. Nothing in
any task log at INFO level; downstream asset-scheduled DAGs never trigger.
Cause: #2879 renders every profile string field through a bare jinja2.Template that
knows none of dbt's filters. | as_number raises
TemplateAssertionError: No filter named 'as_number', which the broadened
except TemplateError in get_dataset_namespace swallows (DEBUG log only) and turns
into return None — and None disables dataset emission for the entire run. A filter
on a field the namespace resolvers never even read (threads, connect_timeout) kills
emission for every model.
Expected: the 1.15.0 behavior (datasets emitted), with #2879's rendering applied
per-field so an unrenderable irrelevant field can't abort namespace derivation — and a
WARNING, not a DEBUG line, if derivation genuinely fails.
Relevant log output
How to reproduce
Standalone, no Airflow run needed. profiles.yml (host is a plain literal; only
threads uses a dbt filter):
repro:
target: dev
outputs:
dev:
type: postgres
host: localhost
port: 5432
user: postgres
password: postgres
dbname: postgres
schema: public
threads: "{{ env_var('DBT_THREADS', 4) | as_number }}"
from cosmos.config import ProfileConfig
from cosmos.dataset import get_dataset_namespace
pc = ProfileConfig(profile_name="repro", target_name="dev",
profiles_yml_filepath="/path/to/profiles.yml")
print(get_dataset_namespace(pc))
# 1.15.0 -> "postgres://localhost:5432" (datasets emitted)
# 1.15.1 -> None (emission skipped for the whole run)
Anything else :)?
Root cause: _get_profile_dict (dataset.py:146, added by #2879) renders every
string field via _resolve_env_var (cosmos/dbt/project.py:44-62 — bare
jinja2.Template, only env_var in context). The compile-time TemplateAssertionError
is caught by the broadened except (dataset.py:170), logged at DEBUG, and returned as
None ⇒ producer sets _dataset_namespace = None (watcher.py:472-474) ⇒ no outlet URIs
for any model. 1.15.0 emitted for this profile; 1.15.1 emits nothing, silently.
Proposed fix (I'd like to submit a PR):
- Render per-field with fallback — on
TemplateError, keep the raw value, log a
WARNING, continue. The namespace resolvers only read host/port-style keys, so
threads/connect_timeout failures become harmless.
- Register dbt's profiles.yml filters (
as_number, as_bool, as_text, as_native)
in _resolve_env_var's environment — dbt's own text environment implements them as
identity functions, sufficient here since Cosmos renders to strings.
- Raise the swallow in
get_dataset_namespace from DEBUG to WARNING — "all asset
emission disabled" should be visible at default log levels.
Regression tests: literal host + as_number on threads ⇒ namespace resolves;
unrenderable field ⇒ raw value kept + WARNING.
Workaround for affected users: replace dbt-only filters with standard Jinja2 ones dbt
also accepts, e.g. | as_number → | int for integer fields.
Are you willing to submit PR?
Contact Details
ignaskr@gmail.com
Astronomer Cosmos Version
1.15.1. Regression from1.15.0, introduced by #2879 (the fix for #2843).dbt Core or Fusion version
dbt Core
1.11.11Versions of dbt adapters
dbt-redshift 1.10.1LoadMode
DBT_LS_MANIFEST
ExecutionMode
WATCHER
InvocationMode
SUBPROCESS
airflow version
3.2.1
Operating System
Amazon Linux
If a you think it's an UI issue, what browsers are you seeing the problem on?
No response
Deployment
Amazon (AWS) MWAA
Deployment details
No response
What happened?
Our
profiles.ymluses dbt's documented profiles.yml filters on numeric fields, e.g.(
as_number/as_boolare documented specifically for profiles.yml:https://docs.getdbt.com/reference/dbt-jinja-functions/as_number. dbt parses and runs
this profile fine.)
After upgrading 1.15.0 → 1.15.1, a WATCHER
DbtDagrun completes fully green but emitszero Assets/dataset events — for every model, not just affected fields. Nothing in
any task log at INFO level; downstream asset-scheduled DAGs never trigger.
Cause: #2879 renders every profile string field through a bare
jinja2.Templatethatknows none of dbt's filters.
| as_numberraisesTemplateAssertionError: No filter named 'as_number', which the broadenedexcept TemplateErroringet_dataset_namespaceswallows (DEBUG log only) and turnsinto
return None— andNonedisables dataset emission for the entire run. A filteron a field the namespace resolvers never even read (
threads,connect_timeout) killsemission for every model.
Expected: the 1.15.0 behavior (datasets emitted), with #2879's rendering applied
per-field so an unrenderable irrelevant field can't abort namespace derivation — and a
WARNING, not a DEBUG line, if derivation genuinely fails.
Relevant log output
How to reproduce
Standalone, no Airflow run needed.
profiles.yml(host is a plain literal; onlythreadsuses a dbt filter):Anything else :)?
Root cause:
_get_profile_dict(dataset.py:146, added by #2879) renders everystring field via
_resolve_env_var(cosmos/dbt/project.py:44-62— barejinja2.Template, onlyenv_varin context). The compile-timeTemplateAssertionErroris caught by the broadened
except(dataset.py:170), logged at DEBUG, and returned asNone⇒ producer sets_dataset_namespace = None(watcher.py:472-474) ⇒ no outlet URIsfor any model. 1.15.0 emitted for this profile; 1.15.1 emits nothing, silently.
Proposed fix (I'd like to submit a PR):
TemplateError, keep the raw value, log aWARNING, continue. The namespace resolvers only read host/port-style keys, so
threads/connect_timeoutfailures become harmless.as_number,as_bool,as_text,as_native)in
_resolve_env_var's environment — dbt's own text environment implements them asidentity functions, sufficient here since Cosmos renders to strings.
get_dataset_namespacefrom DEBUG to WARNING — "all assetemission disabled" should be visible at default log levels.
Regression tests: literal host +
as_numberonthreads⇒ namespace resolves;unrenderable field ⇒ raw value kept + WARNING.
Workaround for affected users: replace dbt-only filters with standard Jinja2 ones dbt
also accepts, e.g.
| as_number→| intfor integer fields.Are you willing to submit PR?
Contact Details
ignaskr@gmail.com