Skip to content

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