We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ObjectStoragePath should be able to handle Jinja Templates
ObjectStoragePath
If I have an operator, that has an ObjectStoragePath argument
class MyOperator(BaseOperator): template_fields = ('path',) def __init__(path, **kwargs): self.path = path super().__init__(**kwargs)
and am using it in a DAG, with templating
MyOperator( ..., path=ObjectStoragePath( "s3://my_bucket/foo/{{ ds_nodash }}/file.csv", conn_id="s3" ) )
Templating didn't seem to work
No response
The text was updated successfully, but these errors were encountered:
acc'd to this https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/operators.html#jinja-templating it looks like ObjectStoragePath doesn't have template_fields =
template_fields =
I tried a few things:
ObjectStoragePath.template_fields = (...) doesn't work, because the init field is *args (I tried with args)
ObjectStoragePath.template_fields = (...)
*args
args
I can't do render_template(...) in my operator, I think, because ObjectStoragePath is read-only
render_template(...)
Sorry, something went wrong.
The current render_template does not handle the case when value is ObjectStoragePath, and I think it can be added.
render_template
As a workaround before it's added, I think you can override render_template in your operator to render and rebuild the path.
Successfully merging a pull request may close this issue.
Description
ObjectStoragePath
should be able to handle Jinja TemplatesUse case/motivation
If I have an operator, that has an ObjectStoragePath argument
and am using it in a DAG, with templating
Templating didn't seem to work
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: