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 breaking change to LogicalTypeEnum.None value #444

Merged
merged 2 commits into from
May 2, 2024

Conversation

adamreeve
Copy link
Contributor

@adamreeve adamreeve commented May 1, 2024

Fixes #443

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

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

Writing this enum type converter seems to be an overkill, but on the other hand there is rather no other option. In large solutions, there is a high chance of having projects compiled against ParquetSharp pre-15.0.2 and 15.0.2, which would cause hard to debug errors at runtime.

PS:
What an odd decision to put the None as the lat value in the enum. It guarantees that each time a new value is added, the value of None needs to be changed as well.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

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

Should we implement additional measures to prevent such mistakes in the future?

@adamreeve
Copy link
Contributor Author

PS: What an odd decision to put the None as the lat value in the enum. It guarantees that each time a new value is added, the value of None needs to be changed as well.

Yeah, this is a little unfortunate and if we'd foreseen this problem we could maybe have mapped None to something different to what the C++ library uses that wasn't going to clash with a future value.

Should we implement additional measures to prevent such mistakes in the future?

This is a good idea, we have some checks that detect if the C++ enum values change (

static_assert(LogicalType::Type::UNDEFINED == 0);
) but I only thought that meant the C# enums needed updating, I missed that this would break the ABI. Maybe we could have some automated tests that build tests against older versions of ParquetSharp and then run them with the current build, which should detect a range of different ABI breaking scenarios.

@adamreeve adamreeve merged commit 5aaff18 into G-Research:master May 2, 2024
33 checks passed
@adamreeve adamreeve deleted the logical_type_unbreak branch May 2, 2024 10:18
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.

[BUG]: 15.0.2 release breaks binary compatibility by changing the value of LogicalTypeEnum.None
2 participants