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

Suppresses griffe logs #7059

Merged
merged 5 commits into from
Oct 5, 2022
Merged

Suppresses griffe logs #7059

merged 5 commits into from
Oct 5, 2022

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Oct 3, 2022

Disables griffe logs by adding a disable_logger context manager.

Also cleans up disable_run_logger by using disable_logger.

Closes #6947.
Closes #6960.

Example

Without this PR:

class A(Block):
    """
    Without disable logger, this spawns griffe warnings.

    Args:
        string (str): This should spawn a warning
    """

results in:

Failed to parse annotation from 'Name' node: 'NoneType' object has no attribute 'resolve'
Failed to parse annotation from 'Name' node: 'NoneType' object has no attribute 'resolve'
Failed to parse annotation from 'Name' node: 'NoneType' object has no attribute 'resolve'

With this PR, those logs are suppressed.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. fix, feature, enhancement

@netlify
Copy link

netlify bot commented Oct 3, 2022

Deploy Preview for prefect-orion ready!

Name Link
🔨 Latest commit e01d4e2
🔍 Latest deploy log https://app.netlify.com/sites/prefect-orion/deploys/633b78def3a19100087440ca
😎 Deploy Preview https://deploy-preview-7059--prefect-orion.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment on lines +412 to +413
with disable_logger("griffe.docstrings.google"):
with disable_logger("griffe.agents.nodes"):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wanted to put this in one line, but too long on one line and it didn't like a parentheses:
d4c3955

@ahuang11 ahuang11 marked this pull request as ready for review October 3, 2022 22:16
@ahuang11 ahuang11 requested a review from zanieb as a code owner October 3, 2022 22:16
@zanieb zanieb added the enhancement An improvement of an existing feature label Oct 3, 2022
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

LGTM!

@ahuang11 ahuang11 merged commit 1dcd456 into main Oct 5, 2022
@ahuang11 ahuang11 deleted the suppress_griffe branch October 5, 2022 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
3 participants