-
Notifications
You must be signed in to change notification settings - Fork 24
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
Ajusta o código para utilizar XCom_pull de múltiplos Tasks IDs. #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muito bom!
Só falta ajustar essa parte.
src/dou_dag_generator.py
Outdated
@@ -344,12 +343,41 @@ def perform_searches( | |||
|
|||
return search_dict | |||
|
|||
def has_matches(self, search_result: list, skip_null: bool) -> str: | |||
def _ensure_list_of_searches(self, specs: DAGConfig) -> list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
O validator do Pydantic já garante que será sempre uma lista. Essa função agora é desnecessária.
src/dou_dag_generator.py
Outdated
searches = specs.search | ||
else: | ||
searches = [specs.search] | ||
searches = self._ensure_list_of_searches(specs=specs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searches = self._ensure_list_of_searches(specs=specs) | |
searches = specs.search |
Já é lista (vide comentário acima).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De acordo!
A partir da versão 2.10 do Airflow foi detectado erro ao chamar múltiplos valores de tasks_ids no xcom_pull.
Código refatorado para fazer o loop entre cada task existente e receber via context e xcom_pull os valores em uma lista.
Fix #139