8000 Fix "all numeric" quoting behavior by ferdnyc · Pull Request #439 · pydot/pydot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix "all numeric" quoting behavior #439

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

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

ferdnyc
Copy link
Member
@ferdnyc ferdnyc commented Nov 27, 2024

The re_all_numeric check used to allow any number of decimal points in the value, which isn't correct for numerics; at most one can be allowed. Rename to re_numeric, and use a more complex RE that allows a maximum of one decimal point, but fails on strings like "1.4.0".

Fixes #438

A new unit test confirms the correct behavior for numeric strings with varying numbers of decimal points.

The `re_all_numeric` che
8000
ck used to allow any number of decimal
points in the value, which isn't correct for numerics; at most one
can be allowed. Rename to `re_numeric`, and use a more complex
RE that allows a maximum of one decimal point, but fails on strings
like "1.4.0".

Fixes pydot#438
@ferdnyc
Copy link
Member Author
ferdnyc commented Nov 27, 2024

@lkk7

It might make sense to backport this onto the v3.0.2 branch, and release a v3.0.3 with this fix, since I don't know that 4.0 is ready to go out the door yet. LMK if you'd like me to put together another PR for that.

(Edit: Actually, it might be better if you first create a v3 branch in the repo for me to target, off the v3.0.2 tag. I'm not sure a PR can target a tag.)

Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/pydot
  core.py
  test
  test_pydot.py
Project Total  

This report was generated by python-coverage-comment-action

@lkk7
Copy link
Member
lkk7 commented Nov 27, 2024

The v3 branch is ready, with the v3.0.2 tag as the latest commit

@ferdnyc ferdnyc mentioned this pull request Nov 28, 2024
lkk7 pushed a commit that referenced this pull request Nov 28, 2024
* Fix numeric-value regular expression

The `re_all_numeric` check used to allow any number of decimal
points in the value, which isn't correct for numerics; at most one
can be allowed. Rename to `re_numeric`, and use a more complex
RE that allows a maximum of one decimal point, but fails on strings
like "1.4.0".

Fixes #438

* Add tests for re_numeric quoting behavior
@lkk7 lkk7 merged commit 0bd243b into pydot:main Nov 28, 2024
23 checks passed
@lkk7
Copy link
Member
lkk7 commented Nov 28, 2024

Thanks, I'll try to release v3.0.3 tomorrow or this weekend.

@ferdnyc ferdnyc deleted the fix-all-numeric branch March 17, 2025 00:48
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.

Pydot considers dotted strings like "1.4.0" to be numeric
2 participants
0