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

Adding time map kml support #136

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Adding time map kml support #136

wants to merge 9 commits into from

Conversation

arnasbr
Copy link
Contributor

@arnasbr arnasbr commented Oct 14, 2024

No description provided.

@arnasbr arnasbr self-assigned this Oct 14, 2024
Comment on lines -37 to +41
) -> T:
) -> Union[T, TimeMapKmlResponse]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a very annoying change to me, cause TimeMapKmlResponse does meet the requirements of the typevar T, but the type checker can't figure that out.
I tried reworking this with abstract ABC classes, couldn't fully resolve all type issues. Maybe in the future I'll look into a bigger type rework for this, but that's an issue for a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to avoid such hacks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea me too, but I think to avoid it I'd need to make a bigger rework, so wanted to do it in a separate PR

Copy link
Contributor

@danielnaumau danielnaumau Oct 23, 2024

Choose a reason for hiding this comment

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

what's the problem with TimeMapKmlResponse cause it looks the same as other response classes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's a very weird issue, the type checker can't resolve that TimeMapKmlResponse can fit into T.
This happens because I have a different parsing method for kml (because it's xml and not json). It's hard to explain, I could show you over a call

@arnasbr arnasbr changed the title adding time map kml Adding time map kml support Oct 16, 2024
@arnasbr arnasbr marked this pull request as ready for review October 16, 2024 10:06
Comment on lines +5 to +9
# The stable version of fastkml is from 2021 and does not have types defined, nor
# a `py.typed` file. There are newer pre-release versions as new as 2024, but they
# seem to be undoccumented.
# TODO: Maybe port this into newer versions of fastkml for proper type checking support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding this, the current version is 0.12. They have 1.0 alpha versions available, seems like they have been slowly developing 1.0 for ~3 years now. It seems pretty vastly different and not documented, so for now I'll keep using the stable version with type checking disabled.

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.

Add support for time map application/vnd.google-earth.kml+xml format
2 participants