-
Notifications
You must be signed in to change notification settings - Fork 4
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 identifier case handling #39
Merged
Merged
Conversation
This file contains 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
mianculovici
approved these changes
Mar 21, 2024
Hello Michael,
Maybe you can remove the if / else condition and just return the variable
"name", in both functions.
Thanks & Best Regards
Vibi
…On Thu, Mar 21, 2024 at 8:52 PM Michael Habiger ***@***.***> wrote:
Description
Removed forced conversion of identifiers to lowercase so that uppercase
and mixed-case scenarios now work properly.
Also removed encoding/decoding of string to bytes. Proper handling (if
needed) will be dealt with via #36
<#36>.
Testing - Python Script
Ran the attached case_test.py which uses SQLAlchemy inspection to get
column information for existing tables. Target DBMS tested: Vector 6.3
database on Ubuntu and Ingres 11.2 database on Windows
case_test.py.txt
<https://github.com/ActianCorp/sqlalchemy-ingres/files/14706188/case_test.py.txt>
Example output
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32
2.0.28
***@***.***:21064/casedb
(['Driver={Actian II};Database=casedb;HostName=TESTMACHINE;ListenAddress=21064;UID=testuser;PWD=TESTPWD'], {})
('II 11.2.0 (a64.win/100)',)
('testuser ', 'otheruser ', '$ingres ')
('DB_DELIMITED_CASE ', 'MIXED ')
('DB_NAME_CASE ', 'LOWER ')
('DB_REAL_USER_CASE ', 'LOWER ')
('MIXEDCASE_NAMES ', 'N ')
============================================================================
================ Table names as stored with actual case ==================
============================================================================
('TABLE UPPER DELIMITED ',)
('Table Mixed Delimited ',)
('table lower delimited ',)
('table_lower ',)
('table_mixed ',)
('table_upper ',)
=====================================================================================
===== Table Names Inspections using SQLAlchemy-Ingres method: get_table_names =====
=====================================================================================
['TABLE UPPER DELIMITED', 'table_lower', 'table lower delimited', 'table_upper', 'Table Mixed Delimited', 'table_mixed']
=======================================================
=============== Columns of each table ===============
=======================================================
Columns for table ( TABLE UPPER DELIMITED ): [{'name': 'COL1 DELIM', 'nullable': True, 'default': None, 'type': Integer()}]
Columns for table ( table_lower ): [{'name': 'col1', 'nullable': True, 'default': None, 'type': Integer()}]
Columns for table ( table lower delimited ): [{'name': 'col1 delim', 'nullable': True, 'default': None, 'type': Integer()}]
Columns for table ( table_upper ): [{'name': 'col1', 'nullable': True, 'default': None, 'type': Integer()}]
Columns for table ( Table Mixed Delimited ): [{'name': 'Col1 Delim', 'nullable': True, 'default': None, 'type': Integer()}]
Columns for table ( table_mixed ): [{'name': 'col1', 'nullable': True, 'default': None, 'type': Integer()}]
Testing - Apache Superset
Python 3.10.12
apache-superset 3.1.1
pyodbc 5.1.0
pypyodbc 1.3.6
SQLAlchemy 1.4.51.dev0
sqlalchemy-ingres 0.0.7.dev1
Tested Superset's auto-retrieval of column metadata and row data in *Superset
SQL Lab*, plus adhoc SQL statements in SQL Lab. Used backends of Ingres
11.2 on Windows and Vector 6.3 on Ubuntu. All sanity tests ran
successfully, correctly retrieving the data.
------------------------------
You can view, comment on, or merge this pull request online at:
#39
Commit Summary
- 3d09cd7
<3d09cd7>
fix identifier case handling #37
- b483e8c
<b483e8c>
Removed decode
File Changes
(1 file <https://github.com/ActianCorp/sqlalchemy-ingres/pull/39/files>)
- *M* lib/sqlalchemy_ingres/base.py
<https://github.com/ActianCorp/sqlalchemy-ingres/pull/39/files#diff-fd5cb38c20c2a27b0d1364dfd9908e23a30dc1ca7e9495da4c63dba924d425cc>
(4)
Patch Links:
- https://github.com/ActianCorp/sqlalchemy-ingres/pull/39.patch
- https://github.com/ActianCorp/sqlalchemy-ingres/pull/39.diff
—
Reply to this email directly, view it on GitHub
<#39>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AZ4C2CGYSBHEMPOGCYY3WHLYZM26FAVCNFSM6AAAAABFCDHEESVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYDCMBUGIYTMOA>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
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.
Description
Removed forced conversion of identifiers to lowercase so that uppercase and mixed-case scenarios now work properly.
Also removed encoding/decoding of string to bytes. Proper handling (if needed) will be dealt with via #36.
Testing - Python Script
Ran the attached case_test.py which uses SQLAlchemy inspection to get column information for existing tables. Target DBMS tested: Vector 6.3 database on Ubuntu and Ingres 11.2 database on Windows
case_test.py.txt
Example output
Testing - Apache Superset
Tested Superset's auto-retrieval of column metadata and row data in Superset SQL Lab, plus adhoc SQL statements in SQL Lab. Used backends of Ingres 11.2 on Windows and Vector 6.3 on Ubuntu. All sanity tests ran successfully, correctly retrieving the data.