Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Conversation

@diogoaihara
Copy link
Contributor

  • Create logging wrapper
  • Remove logging handler

@diogoaihara diogoaihara requested a review from Mr-Lopes October 18, 2022 01:03
@diogoaihara diogoaihara marked this pull request as ready for review October 20, 2022 20:04
Copy link
Contributor

@Mr-Lopes Mr-Lopes left a 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 \
Copy link
Contributor

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.

Copy link
Contributor

@Mr-Lopes Mr-Lopes left a comment

Choose a reason for hiding this comment

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

Added comments.

}

logger.info(f'Conversions: \n{conversions}')
logger.info(f'Conversions: \n{conversions}', execution=execution)
Copy link
Contributor

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'"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants