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

2763 dont trigger telegram flow if no infographics #2764

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

tkalir
Copy link
Collaborator

@tkalir tkalir commented Jan 14, 2025

No description provided.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 2.63158% with 37 lines in your changes missing coverage. Please review.

Project coverage is 52.44%. Comparing base (07a333b) to head (763d643).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
anyway/telegram_accident_notifications.py 4.34% 22 Missing ⚠️
anyway/infographic_image_generator.py 0.00% 15 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2764      +/-   ##
==========================================
- Coverage   52.57%   52.44%   -0.13%     
==========================================
  Files         122      122              
  Lines       10232    10256      +24     
==========================================
  Hits         5379     5379              
- Misses       4853     4877      +24     
Flag Coverage Δ
unittests 52.44% <2.63%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tkalir tkalir self-assigned this Jan 14, 2025
@tkalir tkalir marked this pull request as draft January 14, 2025 19:07
else TELEGRAM_POST_VERIFICATION_CHANNEL_CHAT_ID
trigger_airflow_dag("generate-and-send-infographics-images", dag_conf)
infographics_data = get_infographics_data_by_newsflash(newsflash_id)
if WIDGETS not in infographics_data:
Copy link
Collaborator

@atalyaalon atalyaalon Jan 19, 2025

Choose a reason for hiding this comment

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

I suggest adding a years_ago param so we'll be able to adjust from get_infographics_data_by_newsflash (and default will be current default - BE_CONST.DEFAULT_NUMBER_OF_YEARS_AGO)

dag_conf = {"news_flash_id": newsflash_id}
dag_conf["chat_id"] = TELEGRAM_CHANNEL_CHAT_ID if pre_verification_chat \
else TELEGRAM_POST_VERIFICATION_CHANNEL_CHAT_ID
trigger_airflow_dag("generate-and-send-infographics-images", dag_conf)
Copy link
Collaborator

@atalyaalon atalyaalon Jan 19, 2025

Choose a reason for hiding this comment

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

I suggest adding the years_ago param to dag_conf to have this flexibility in this dag as well, can be useful in the future

@atalyaalon
Copy link
Collaborator

@tkalir looks good! Added small comments and also Pylint tests need to be fixed. After that I suggest we'll merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants