Skip to content

CLI incorrectly parses schema containing "." character #698

Open

Description

@Vfisa

In my case I have tried with this schema:
in.c-data-diff-prep
resulted in this error:
Screenshot 2023-05-18 at 11 22 32

Activity

  1. ctiml commented on May 23, 2023

    @ctiml
    Contributor

    @Vfisa Thank you for filing the issue. We can reproduce it and will try to fix it.

    for internal tracking: sc-31444

  2. popcornylu commented on Jun 12, 2023

    @popcornylu
    Contributor

    This issue is a bit more complicated than we expect.

    We use the SQLAlchemy library at the underlying level to connect to databases and data warehouses. In the Snowflake engine, we have tried various approaches but have been unable to retrieve table metadata from a schema that contains dots in its name. Below is an very simple example

    from sqlalchemy import create_engine
    import urllib.parse
    
    account = '<account>'
    user = '<user>'
    password = '<password>'
    database = '<database>'
    schema = 'DBT.TEST'
    # schema = '"DBT.TEST"'  
    warehouse = '<warehouse>' 
    
    connection_string = f'snowflake://{user}:{password}@{account}/{database}'
    if schema:
        connection_string += f'?schema={urllib.parse.quote(schema)}'
    if warehouse:
        connection_string += f'&warehouse={warehouse}'
    
    
    engine = create_engine(connection_string)
    

    query the columns in a table.

    from sqlalchemy import Table, MetaData
    Table("mytable", MetaData(), autoload_with=engine, schema=schema)
    

    We will investigate the same issue in sqlalchemy+duckdb, to see if it is sqlalchemy issue or snowflake-sqlalchemy

  3. popcornylu commented on Sep 21, 2023

    @popcornylu
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions