Skip to content
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

Merged
merged 6 commits into from
Sep 4, 2024

Conversation

edulauer
Copy link
Member

@edulauer edulauer commented Sep 4, 2024

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

@edulauer edulauer added the bug Something isn't working label Sep 4, 2024
Copy link
Member

@augusto-herrmann augusto-herrmann left a 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.

@@ -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:
Copy link
Member

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.

searches = specs.search
else:
searches = [specs.search]
searches = self._ensure_list_of_searches(specs=specs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
searches = self._ensure_list_of_searches(specs=specs)
searches = specs.search

Já é lista (vide comentário acima).

Copy link
Member Author

@edulauer edulauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De acordo!

@edulauer edulauer merged commit 97dea73 into main Sep 4, 2024
1 check passed
@edulauer edulauer deleted the fix_xcom_pull branch September 4, 2024 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Erro ao chamar múltiplos valores de tasks_ids no xcom_pull
2 participants