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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump gcal_sync to 0.6.2 and switch to google calendar async iterator api #70616

Merged
merged 5 commits into from Apr 27, 2022

Conversation

allenporter
Copy link
Contributor

@allenporter allenporter commented Apr 25, 2022

Proposed change

Update google calendar to use a new async iterator api when paging through events, a followup discussed in #70173

Diff: allenporter/gcal_sync@0.5.0...0.6.2

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

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
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

@project-bot project-bot bot added this to Needs review in Dev Apr 25, 2022
@project-bot project-bot bot moved this from Needs review to By Code Owner in Dev Apr 25, 2022
@allenporter allenporter marked this pull request as draft April 25, 2022 05:14
@allenporter
Copy link
Contributor Author

allenporter commented Apr 25, 2022

In draft while I figure out this error (doesn't happen in my py 3.9. tests, but happens here)

/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
    ???
<frozen importlib._bootstrap>:1007: in _find_and_load
    ???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:680: in _load_unlocked
    ???
venv/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
tests/components/google/conftest.py:14: in <module>
    from homeassistant.components.google import CONF_TRACK_NEW, DOMAIN
homeassistant/components/google/__init__.py:11: in <module>
    from gcal_sync.api import GoogleCalendarService
venv/lib/python3.9/site-packages/gcal_sync/api.py:64: in <module>
    class ListEventsResponse(BaseModel):
pydantic/main.py:187: in pydantic.main.ModelMetaclass.__new__
    ???
pydantic/typing.py:356: in pydantic.typing.resolve_annotations
    ???
/usr/local/lib/python3.9/typing.py:254: in _eval_type
    return t._evaluate(globalns, localns, recursive_guard)
/usr/local/lib/python3.9/typing.py:493: in _evaluate
    eval(self.__forward_code__, globalns, localns),
<string>:1: in <module>
    ???
/usr/local/lib/python3.9/typing.py:243: in inner
    return func(*args, **kwds)
/usr/local/lib/python3.9/typing.py:316: in __getitem__
    return self._getitem(self, parameters)
/usr/local/lib/python3.9/typing.py:433: in Optional
    return Union[arg, type(None)]
/usr/local/lib/python3.9/typing.py:243: in inner
    return func(*args, **kwds)
/usr/local/lib/python3.9/typing.py:316: in __getitem__
    return self._getitem(self, parameters)
/usr/local/lib/python3.9/typing.py:421: in Union
    parameters = _remove_dups_flatten(parameters)
/usr/local/lib/python3.9/typing.py:215: in _remove_dups_flatten
    all_params = set(params)
E   TypeError: unhashable type: 'list'

@MartinHjelmare
Copy link
Member

MartinHjelmare commented Apr 25, 2022

I think you need to use List and Dict in pydantic model attribute types instead of list and dict.

https://github.com/allenporter/gcal_sync/blob/8e0ccecb1f905e6cb2c90e0b32f1d2e8236ead2e/gcal_sync/api.py#L67

@allenporter allenporter changed the title Bump gcal_sync to 0.6.0 and switch to google calendar async iterator api Bump gcal_sync to 0.6.1 and switch to google calendar async iterator api Apr 27, 2022
@allenporter allenporter changed the title Bump gcal_sync to 0.6.1 and switch to google calendar async iterator api Bump gcal_sync to 0.6.2 and switch to google calendar async iterator api Apr 27, 2022
Dev automation moved this from By Code Owner to Reviewer approved Apr 27, 2022
@allenporter allenporter marked this pull request as ready for review April 27, 2022 06:29
@allenporter allenporter merged commit 8a13c67 into home-assistant:dev Apr 27, 2022
Dev automation moved this from Reviewer approved to Done Apr 27, 2022
@allenporter allenporter deleted the calendar-async-iterator branch April 27, 2022 14:28
@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants