-
Notifications
You must be signed in to change notification settings - Fork 56
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
Upgrade logging #113
base: main
Are you sure you want to change the base?
Upgrade logging #113
Conversation
diogoaihara
commented
Oct 18, 2022
- Create logging wrapper
- Remove logging handler
Sample Service Account file for GCP auth inside docker
* Fix BatchesFromExecutions: size estimation overflow + filter by destination type in process func * Explanation about estimate_size
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.
Please see comments
summary_of_records = execution.summary_of_records | ||
msg = f"{execution_counter}. {key}:\n \ | ||
- Type: {str(execution.destination.destination_type)[16:]}\n \ | ||
- Total records: {summary_of_records['total']}\n \ |
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.
total_records is never set, making the total always equal to 0.
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.
Added comments.
@@ -132,14 +132,14 @@ def _do_upload_data( | |||
'conversions': conversions, | |||
} | |||
|
|||
logger.info(f'Conversions: \n{conversions}') | |||
logger.info(f'Conversions: \n{conversions}', execution=execution) |
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.
when executing in a container, the execution parameter throws an error:
"Traceback (most recent call last):
File "apache_beam/runners/common.py", line 1198, in apache_beam.runners.common.DoFnRunner.process
File "apache_beam/runners/common.py", line 537, in apache_beam.runners.common.SimpleInvoker.invoke_process
File "/app/megalista_dataflow/uploaders/utils.py", line 74, in inner
logger.info(f'Uploading {len(batch.elements)} rows...', execution=batch.execution)
File "/usr/local/lib/python3.9/logging/__init__.py", line 1446, in info
self._log(INFO, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'execution'"