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

Support get_view_names #303

Closed
yu-iskw opened this issue Jan 26, 2023 · 0 comments · Fixed by #306 or #292
Closed

Support get_view_names #303

yu-iskw opened this issue Jan 26, 2023 · 0 comments · Fixed by #306 or #292
Assignees
Labels
api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@yu-iskw
Copy link

yu-iskw commented Jan 26, 2023

Is your feature request related to a problem? Please describe.
I would like to catalog tables and views of Spanner on OpenMetadata. To do so, I would like to extract metadata of not only tables but also views.

Code to reproduce

from sqlalchemy import (
    Column,
    Integer,
    MetaData,
    String,
    Table,
    create_engine,
    inspect,
)

url = "spanner+spanner:///projects/xxx/instances/xxx/databases/xxx"
engine = create_engine(url)
metadata = MetaData(bind=engine)
insp = inspect(engine)

insp.get_view_names()

Error message

File ~/anaconda2/envs/python3.9/lib/python3.9/site-packages/sqlalchemy/engine/reflection.py:412, in Inspector.get_view_names(self, schema)
    404 """Return all view names in `schema`.
    405 
    406 :param schema: Optional, retrieve names from a non-default schema.
    407  For special quoting, use :class:`.quoted_name`.
    408 
    409 """
    411 with self._operation_context() as conn:
--> 412     return self.dialect.get_view_names(
    413         conn, schema, info_cache=self.info_cache
    414     )

File ~/anaconda2/envs/python3.9/lib/python3.9/site-packages/sqlalchemy/engine/interfaces.py:332, in Dialect.get_view_names(self, connection, schema, **kw)
    326 def get_view_names(self, connection, schema=None, **kw):
    327     """Return a list of all view names available in the database.
    328 
    329     :param schema: schema name to query, if not the default schema.
    330     """
--> 332     raise NotImplementedError()

NotImplementedError: 

Describe the solution you'd like
We can implement get_view_names.

Describe alternatives you've considered
N/A

Additional context
I am working on the issue of OpenMetadata.

@yu-iskw yu-iskw added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Jan 26, 2023
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. label Jan 26, 2023
gcf-merge-on-green bot pushed a commit that referenced this issue Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner-sqlalchemy API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
2 participants