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

Added empty dictionary for ComputeError extras default instead of None #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

coltonbh
Copy link
Collaborator

@coltonbh coltonbh commented Feb 4, 2023

Description

As per previous discussion about native_files when we have empty fields that are dict objects we want their default value to be {} not None. {} evaluates falsey in python so it can still be treated as a "null object" and we remove needing to check the case of None for .extras. This makes coding easier because we can always do:

compute_error.extras['hi'] = 'new value'

Instead of having to always check this first:

if compute_error.extras is None:
    compute_error.extras = {"hi': 'new value}
else:
    compute_error.extras["hi'] =  'new value

Changelog description

Change default value for ComputeError.extra from None to {}

Status

  • [ x] Code base linted
  • [ x] Ready to go

@codecov
Copy link

codecov bot commented Feb 4, 2023

Codecov Report

Merging #301 (d00d676) into master (d04a380) will decrease coverage by 0.04%.
The diff coverage is n/a.

Additional details and impacted files

@coltonbh
Copy link
Collaborator Author

coltonbh commented Feb 4, 2023

I think something might be funny with the Format GitHub action. When I run black locally using python3.7 everything is good.

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.

1 participant