-
Notifications
You must be signed in to change notification settings - Fork 185
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
on DbtTaskGroup creation dag parameter is ignored. #915
Comments
To address the issue where the
def airflow_kwargs(**kwargs):
"""
Ensure 'dag' parameter is correctly handled.
"""
new_kwargs = {}
for arg_key, arg_value in kwargs.items():
if arg_key == 'dag': # Explicitly include 'dag'
new_kwargs[arg_key] = arg_value
return new_kwargs
These adjustments should help in resolving the issue with the Sources
|
This code fixes the problem that dag parameter cannot be passed as argument at `DbtTaskGroup`. Previously, this would work: ``` with DAG(...): DbtTaskGroup(...) ``` But this would fail: ``` dag = DAG(...) DbtTaskGroup(dag=dag...) ``` Both work now. This change has been made to not affecting `DbtToAirflowConverter` class at all. Closes: astronomer#915
Currently, there is an issue when attempting to create a
DbtTaskGroup
using the dag parameter directly. However, this limitation can be bypassed using the with statement, where there is no issue.Functional example:
Problematic example:
This problem stems from the
airflow_kwargs
function withinconverter.py
. Although thedag
argument is assumed to be present inDbtToAirflowConverter
, this parameter is not being passed to the creation ofTaskGroup
.I suggest two potential solutions to the problem:
DbtTaskGroup
operator to explicitly pass thedag
parameter when creating the task group.airflow_kwargs
function to ensure that the dag parameter is properly handled when creating the TaskGroup.The text was updated successfully, but these errors were encountered: