Case handling, datetime handling and geometry updates - #123
Open
Milo-Dias wants to merge 3 commits into
Open
Conversation
dotnet.py: Keep strings unchanged during .NET conversion. queries.py: Parse strings only for schema-declared DateTime fields. queries.py: Restore case-insensitive field names for inserts. queries.py: Send geometry updates through UpdateGeomByCommand and raise an error if they fail.
ryan-kipawa
self-requested a review
July 16, 2026 18:12
ryan-kipawa
requested changes
Jul 16, 2026
ryan-kipawa
left a comment
Collaborator
There was a problem hiding this comment.
Great work! I have some feedback that we could iterate on:
- Add failing tests for all of the fixes. These are new/modified tests that fail on the main branch, but then pass with the fixes of this PR.
- For case-sensitivity: this may be an issue limited to postgres rather than sqlite. Pinpointing the issue slightly could reveal a solution that's easier to maintain. I partly wonder if this could be handled upstream by MIKE+.
- The
dotnet.pymodule is intended for code related to Python <--> .NET type conversions. I think the datetime parsing logic should go there - this may require extending it to be aware of the column's data type.
Author
Thank you so much for your feedback Ryan and for your time invested into it, I agree with your three points :) I will add regression tests covering all that I have touched. The original case-sensitivity failure was reproduced with an SQLite MIKE+ model, so I will test it out and document it. And investigate whether InsertByCommand should be corrected upstream in MIKE+ or not. I will also move datetime parsing back into dotnet.py I will keep you updated, |
added 2 commits
July 22, 2026 12:27
Refs DHI#123 - Preserve arbitrary strings such as "760309" and "33,34" instead of interpreting them as dates. - Parse strings as DateTime only when the destination MIKE+ field is schema-declared as DbType.DateTime. - Restore case-insensitive insert field names by mapping them to canonical schema names. - Send geometry updates through UpdateGeomByCommand and raise an error when the command does not commit. - Add eight regression tests covering conversion, SQLite inserts, geometry persistence, command routing, and failed commits. All eight tests fail against upstream main (fc2836c) and pass with these fixes. Addresses DHI#119. Please try it out and give feedback :) Thank you so much for your time, mila
Problem: Numeric strings were interpreted according to the computer’s regional settings. A value such as "1,2" could insert as NULL or cause an update failure on a dot-decimal computer, with the reverse risk for "1.2" on comma-decimal computers. Fix: Convert strings for schema-declared DbType.Double fields using either "." or "," before sending them to MIKE+. Invalid strings remain unchanged. Tests: Added converter tests and Sirius insert/update regression tests for both decimal separators.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fix