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

SNOW-1794369 Catalog API #2655

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#### New Features

- Added support for property `version` and class method `get_active_session` for `Session` class.
- Added `Catalog` class to manage snowflake objects. It can be accessed via `Session.catalog`.
- Added new methods and variables to enhance data type handling and JSON serialization/deserialization:
- To `DataType`, its derived classes, and `StructField`:
- `type_name`: Returns the type name of the data.
Expand Down
63 changes: 63 additions & 0 deletions docs/source/snowpark/catalog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
=============
Catalog
=============
Catalog module for Snowpark.

.. currentmodule:: snowflake.snowpark.catalog

.. rubric:: Catalog

.. autosummary::
:toctree: api/

Catalog.databaseExists
Catalog.database_exists
Catalog.dropDatabase
Catalog.dropSchema
Catalog.dropTable
Catalog.dropView
Catalog.drop_database
Catalog.drop_schema
Catalog.drop_table
Catalog.drop_view
Catalog.getCurrentDatabase
Catalog.getCurrentSchema
Catalog.getProcedure
Catalog.getTable
Catalog.getUserDefinedFunction
Catalog.getView
Catalog.get_current_database
Catalog.get_current_schema
Catalog.get_procedure
Catalog.get_table
Catalog.get_user_defined_function
Catalog.get_view
Catalog.listColumns
Catalog.listDatabases
Catalog.listProcedures
Catalog.listSchemas
Catalog.listTables
Catalog.listUserDefinedFunctions
Catalog.listViews
Catalog.list_columns
Catalog.list_databases
Catalog.list_procedures
Catalog.list_schemas
Catalog.list_tables
Catalog.list_user_defined_functions
Catalog.list_views
Catalog.procedureExists
Catalog.procedure_exists
Catalog.schemaExists
Catalog.schema_exists
Catalog.setCurrentDatabase
Catalog.setCurrentSchema
Catalog.set_current_database
Catalog.set_current_schema
Catalog.tableExists
Catalog.table_exists
Catalog.userDefinedFunctionExists
Catalog.user_defined_function_exists
Catalog.viewExists
Catalog.view_exists

7 changes: 4 additions & 3 deletions docs/source/snowpark/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Snowpark APIs
column
types
row
functions
window
grouping
functions
window
grouping
table_function
table
async_job
Expand All @@ -21,6 +21,7 @@ Snowpark APIs
udtf
observability
files
catalog
lineage
context
exceptions
Expand Down
1 change: 1 addition & 0 deletions docs/source/snowpark/session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Snowpark Session
Session.append_query_tag
Session.call
Session.cancel_all
Session.catalog
Session.clear_imports
Session.clear_packages
Session.close
Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ requirements:
# Snowpark IR
- protobuf >=3.20,<6
- tzlocal
- snowflake >=1.0.0,<2

test:
imports:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# `protoc` < 3.20 is not able to generate protobuf code compatible with protobuf >= 3.20.
"protobuf>=3.20, <6", # Snowpark IR
"tzlocal", # Snowpark IR
"snowflake>=1.0.0, <2", # Catalog
]
REQUIRED_PYTHON_VERSION = ">=3.8, <3.12"

Expand Down
Loading
Loading