Skip to content

Commit

Permalink
* Run lint and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ag-ramachandran committed Nov 22, 2024
1 parent 6ebc7ba commit 07a779f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions sqlalchemy_kusto/dialect_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ def schema_definition(column):
}

def get_view_names(self, connection: Connection, schema: Optional[str] = None, **kwargs) -> List[str]:
mvs = connection.execute(".show materialized-views | project Name")
materialized_views = connection.execute(".show materialized-views | project Name")
# Functions are also Views.
# Filtering no input functions specifically here as there is no way to pass parameters today
functions = connection.execute(".show functions | where Parameters =='()' | project Name")
mv = [row.Name for row in mvs]
materialized_view = [row.Name for row in materialized_views]
view = [row.Name for row in functions]
return mv + view
return materialized_view + view

def get_pk_constraint(self, connection: Connection, table_name: str, schema: Optional[str] = None, **kw):
return {"constrained_columns": [], "name": None}
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/test_dialect_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ def test_get_table_names(temp_table_name):
result = engine.dialect.get_table_names(conn)
assert temp_table_name in result


def test_get_view_names(temp_table_name):
conn = engine.connect()
result = engine.dialect.get_view_names(conn)
assert f"{temp_table_name}_fn" in result


def test_get_columns(temp_table_name):
conn = engine.connect()
columns_result = engine.dialect.get_columns(conn, temp_table_name)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

def test_operational_error():
wrong_tenant_id = "wrong_tenant_id"
azure_ad_client_id="x"
azure_ad_client_secret="x"
azure_ad_client_id = "x"
azure_ad_client_secret = "x"
engine = create_engine(
f"{KUSTO_SQL_ALCHEMY_URL}/{DATABASE}?"
f"msi=False&azure_ad_client_id={azure_ad_client_id}&"
Expand Down

0 comments on commit 07a779f

Please sign in to comment.