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

Fix issue when timestamp is None #130133

Merged
merged 8 commits into from
Nov 8, 2024
Merged

Conversation

shaiu
Copy link
Contributor

@shaiu shaiu commented Nov 8, 2024

Proposed change

Fix issue when timestamp is None. Check first for None before applying isoformat on it

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
  • I have followed the [perfect PR recommendations][perfect-pr]
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

Copy link
Contributor

@epenet epenet left a comment

Choose a reason for hiding this comment

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

Avoid multi-line ternary

homeassistant/components/seventeentrack/services.py Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft November 8, 2024 13:49
@home-assistant
Copy link

home-assistant bot commented Nov 8, 2024

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@shaiu shaiu marked this pull request as ready for review November 8, 2024 14:01
@home-assistant home-assistant bot requested a review from epenet November 8, 2024 14:01
@shaiu shaiu requested a review from dgomes November 8, 2024 14:01
@home-assistant home-assistant bot marked this pull request as draft November 8, 2024 14:03
@@ -110,6 +99,22 @@ async def archive_package(call: ServiceCall) -> None:

await seventeen_coordinator.client.profile.archive_package(tracking_number)

def package_to_dict(package):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add type hints here also?

    def package_to_dict(package: xtz) -> dict[str, Any]:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@shaiu shaiu marked this pull request as ready for review November 8, 2024 14:07
@home-assistant home-assistant bot requested a review from epenet November 8, 2024 14:07
@epenet epenet added this to the 2024.11.1 milestone Nov 8, 2024
Copy link
Contributor

@epenet epenet left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@frenck frenck merged commit c4762f3 into home-assistant:dev Nov 8, 2024
32 checks passed
frenck pushed a commit that referenced this pull request Nov 8, 2024
@frenck frenck mentioned this pull request Nov 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seventeentrack get_packages throws error when package has no valid timestamp
4 participants