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

feat(ingest): enable EnsureAspectSizeProcessor for all sources #12262

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Jan 2, 2025

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@hsheth2 hsheth2 requested review from skrydal and anshbansal January 2, 2025 21:13
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jan 2, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Jan 2, 2025
@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Jan 3, 2025
Comment on lines +297 to +298
if _DATAHUB_EMITTER_TRACE:
logger.debug(f"Attempting to emit MCP batch of size {len(mcps)}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could remove such repeated conditionals, how about simply adding new function to the logging, i.e. in logging_manager.py:

def trace(self: logging.Logger, message: str, *args: Any, **kwargs: Any):
    env = f'TRACE_{self.name.replace(".", "__").upper()}'
    if get_boolean_env_variable(env, False):
        self._log(logging.DEBUG, message, args, **kwargs)


logging.Logger.trace = trace

Then here we would be only calling logger.trace(...). the variable to be exported in this case would be:

export TRACE_DATAHUB__EMITTER__REST_EMITTER=true

It would be quite universal piece of code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately mypy really doesn't like this type of patching

I agree with you that the code duplication isn't ideal, but it's better than having type: ignore everywhere. If there's an alternative that doesn't require that, I'm all ears

@skrydal
Copy link
Collaborator

skrydal commented Jan 3, 2025

I agree with the spirit of the change with regards to the workunit processor placement. I think we should avoid repeated conditionals when debug logging, proposed a solution in a comment.

@hsheth2 hsheth2 merged commit ba8bf53 into master Jan 6, 2025
110 of 111 checks passed
@hsheth2 hsheth2 deleted the emitter-aspect-check branch January 6, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata pending-submitter-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants