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

Ensure lastrowid value exists before trying to assign it #47

Merged
merged 1 commit into from
May 1, 2024

Conversation

hab6
Copy link
Contributor

@hab6 hab6 commented May 1, 2024

Description

Fix that avoids trying to assign a value in cases where no value exists after calling the Ingres LAST_IDENTITY function during SQL post processing.

Prevents error: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' when running a number of tests.

Environment

Ingres 11.2 (15807) on Windows 10 (client & server are same)
Python 3.10.7
mock 5.1.0
packaging 24.0
pip 24.0
pluggy 1.5.0
pyodbc 5.1.0
pypyodbc 1.3.6
pytest 8.2.0
setuptools 63.2.0
SQLAlchemy 2.0.29.dev0
sqlalchemy-ingres 0.0.7.dev1
tox 4.15.0

Related ticket: II-14233

Results using various tests from the SQLAlchemy dialect compliance suite

WITHOUT FIX Pass Fail
BinaryTest 0 3
DateTest 2 4
DateTimeCoercedToDateTimeTest 2 4
DateTimeMicrosecondsTest 0 5
DateTimeTest 2 4
DifficultParametersTest 42 21
IntegerTest 1 22
IsOrIsNotDistinctFromTest 0 5
Results without fix 49 68
WITH FIX Pass Fail
BinaryTest 3 0
DateTest 6 0
DateTimeCoercedToDateTimeTest 6 0
DateTimeMicrosecondsTest 2 3 (a)
DateTimeTest 6 0
DifficultParametersTest 63 0
IntegerTest 12 11 (b)
IsOrIsNotDistinctFromTest 5 0
Results with fix 103 14

(a) Different error now occurs: AssertionError
(b) Different error now occurs due to unrelated bad SQL syntax

@hab6 hab6 requested review from mianculovici and vsreeniv May 1, 2024 19:12
Copy link

@mianculovici mianculovici left a comment

Choose a reason for hiding this comment

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

Approved.

@hab6 hab6 merged commit cb52e05 into master May 1, 2024
@hab6 hab6 deleted the hab6-fix-nonetype branch May 1, 2024 20:18
hab6 added a commit that referenced this pull request May 1, 2024
Bump dev version to differentiate before/after merge of #46 #47.
@hab6 hab6 mentioned this pull request May 1, 2024
hab6 added a commit that referenced this pull request May 1, 2024
Bump dev version to differentiate before/after merge of #46 #47.
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.

2 participants