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

fix for Nonetype: None in the ERROR logs #400

Merged
merged 1 commit into from
Jul 2, 2024
Merged

fix for Nonetype: None in the ERROR logs #400

merged 1 commit into from
Jul 2, 2024

Conversation

gulshan02
Copy link
Contributor

@gulshan02 gulshan02 commented Jul 2, 2024

What: Observed NoneType: None in preprocess and inference UDFs. Example:
2024-07-02 03:44:26,863 - 139658258261696 - ERROR - uuid='2a4ae443-15ab-496c-95ba-83ebc380df59' event='Artifact model not loaded!' udf_vertex='inference' config_id='serviceTraceMetrics' pipeline_id='request' metadata={'adjust_with_impact': {'timestamp': 1719891659999, 'true': 0}, 'mean_of_features': {'true': 0.23076923076923078}, 'numalogic_opex_tags': {'source': 'numalogic_metrics'}, 'tags': {'assetAlias': 'Intuit.cto.iam.iux', 'assetId': '3172803529671879897', 'env': 'prd', 'opname': 'GET /fe_logger/.env.dev.local'}} exc_info=True level='error' timestamp='2024-07-02T03:44:26.863733Z' NoneType: None

Why: logger.exception is usually called from the except block. Not logging from the except block, means there is no execution_info provided. As a result, sys_exec.info() call from logging stdlib return (None, None, None) for type, value and stackTrace of exception.

How: Either write logger.exception inside the except block or use logger.error instead.

Signed-off-by: Gulshan Bhatia <gulshan_bhatia@intuit.com>
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.11%. Comparing base (b8b8f2b) to head (3fd4655).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #400   +/-   ##
=======================================
  Coverage   92.11%   92.11%           
=======================================
  Files          97       97           
  Lines        4782     4782           
  Branches      430      430           
=======================================
  Hits         4405     4405           
  Misses        279      279           
  Partials       98       98           

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

@gulshan02 gulshan02 marked this pull request as ready for review July 2, 2024 04:06
@gulshan02 gulshan02 self-assigned this Jul 2, 2024
@gulshan02 gulshan02 merged commit 2a44312 into main Jul 2, 2024
13 checks passed
@gulshan02 gulshan02 deleted the nonetype-fix branch July 2, 2024 18:23
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.

2 participants