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

Text encoding issues migrating Home Assistant data #3

Closed
maxlyth opened this issue Aug 29, 2024 · 6 comments
Closed

Text encoding issues migrating Home Assistant data #3

maxlyth opened this issue Aug 29, 2024 · 6 comments

Comments

@maxlyth
Copy link
Contributor

maxlyth commented Aug 29, 2024

Thank you for the this fork and the work to add the logic for HomeAssistant migrations. It got me 80% of the way there but I still experienced significant issues while migrating my Influx2 HA dataset.

My issues were related to text encoding and your version of the code not correctly complying to the Influx Line Protocol Standard, especially the section about escaping and quoting.

I have modified the code to correctly escape the names and values of keys and the value columns is now quoted for strings with escaped ", /r, /n as these would break the line protocol. I have a pretty diverse dataset and managed to migrate over 4GB without any problems.

I have forked this repo with documentation and significant changes, including a Dev Container definition which should make it a lot easier for anyone to run a migration when not familiar with Python.

@frli4797
Copy link
Owner

Great stuff that you found this useful. I'm amazed that the encoding problem didn't give me any issues when migrating my dataset. (Why is character encoding still such a mess?)

I'd love if you'd create a PR for your changes to merge back to my repo, to ensure that my mistakes don't spread to other unfortunate users of my hack. Thanks!

@maxlyth
Copy link
Contributor Author

maxlyth commented Aug 30, 2024 via email

@frli4797
Copy link
Owner

frli4797 commented Aug 31, 2024

Hey! I'm not the one to nitpick when people are good-hearted enough to share their time and effort to make a piece of code better, or even less bad, given that I'm not a very good developer anymore. You're more than welcome to help me, and more important any other unfortunate soul that could venture into using this code.

I'm very likely to just merge your PR, would you be willing to create one, as I no longer possess a data set to test with. But given your tests and review, I am sure that it would improve things just as it is.

@frli4797
Copy link
Owner

frli4797 commented Sep 1, 2024

Had a boring afternoon and created a PR off your changes, then did some minor alterations in the readme and merged back to this repo. Made sure to mention you/your fork as the originator of these fixes.

@frli4797
Copy link
Owner

frli4797 commented Sep 1, 2024

Fixed by #5

@frli4797 frli4797 closed this as completed Sep 1, 2024
@maxlyth
Copy link
Contributor Author

maxlyth commented Sep 5, 2024 via email

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

No branches or pull requests

2 participants