You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/07/07 18:28:25 UTC

[GitHub] [phoenix-queryserver] stoty commented on a change in pull request #42: PHOENIX-5994 SqlAlchemy schema filtering incorrect semantics

stoty commented on a change in pull request #42:
URL: https://github.com/apache/phoenix-queryserver/pull/42#discussion_r451061757



##########
File path: python-phoenixdb/phoenixdb/tests/test_sqlalchemy.py
##########
@@ -52,6 +52,39 @@ def test_textual(self):
             finally:
                 connection.execute('drop table if exists ALCHEMY_TEST')
 
+    def test_schema_filtering(self):
+        engine = self._create_engine()
+        with engine.connect() as connection:
+            try:
+                connection.execute('drop table if exists ALCHEMY_TEST')
+                connection.execute('drop table if exists A.ALCHEMY_TEST_A')
+                connection.execute('drop table if exists B.ALCHEMY_TEST_B')
+
+                connection.execute(text('create table ALCHEMY_TEST (ID integer primary key)'))
+                connection.execute(text('create table A.ALCHEMY_TEST_A (ID_A integer primary key)'))
+                connection.execute(text('create table B.ALCHEMY_TEST_B (ID_B integer primary key)'))
+
+                inspector = db.inspect(engine)
+
+                self.assertEqual(inspector.get_schema_names(), [None, 'A', 'B', 'SYSTEM'])

Review comment:
       I am not actually sure. The documentation doesn't specify this.
   
   The internal representation in Phoenix is null, which translates to None.
   When specifying the schema filter, the default schema is also represented in sqlAlchemy by None.
   
   Based on this, returning None here seems to make sense. 
   
   I'll try to figure out what i.e. the mysql driver returns here, and adjust if it returns ''
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org