Open
Conversation
parfenovma
requested changes
May 16, 2025
| base_url = "https://github.com/profcomff/dwh-pipelines/blob/main/" | ||
|
|
||
|
|
||
| class DAG_TEMPLATE(DAG): |
Contributor
There was a problem hiding this comment.
DAG это аббривеатура, поэтому она капсом написана
а ПравильноеНазваниеКапса обычно в CamelCase
то есть DAGTemplate
)
| 'execution_timeout': timedelta(minutes=30), | ||
| } | ||
|
|
||
| super().__init__(dag_id=dag_id, default_args=self.default_task_args, **default_dag_args) |
Contributor
There was a problem hiding this comment.
super(DAGTemplate, self).init(...)
| 'execution_timeout': timedelta(minutes=30), | ||
| } | ||
|
|
||
| super().__init__(dag_id=dag_id, default_args=self.default_task_args, **default_dag_args) |
Contributor
There was a problem hiding this comment.
стоит наверное дальше прокидывать **kwargs раз уж они есть
|
|
||
| class DAG_TEMPLATE(DAG): | ||
|
|
||
| def __init__(self, dag_id: str, path: str, **kwargs): |
Contributor
There was a problem hiding this comment.
для полиморфизма следует соблюдать единство интерфейса конструктора класса-наследника и класса-родителя
Contributor
There was a problem hiding this comment.
почувствовал себя преподом по информатике щас
| 'catchup': False, | ||
| 'doc_md': base_url + path, | ||
| 'on_failure_callback': lambda ctx: alert_message(chat_id=get_chat_id(), context=ctx), | ||
| **kwargs, |
Contributor
There was a problem hiding this comment.
а если я хочу переопределить в kwargs catchup например? будет SyntaxError?
либо:
- default_dag_args.update(kwargs)
- посмотреть какая в DAG.init сигнатура и согласно ей апдейтить этот словарь (я о том что скорее там нет kwargs но все аргументы хочется передавать в init базового класса)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Написал шаблончик. Попробовал вызывать алерт через лямбда функцию (мне кажется так эстетичнее). Также этот ПР должен исправлять ошибку импорта integrity_check