Skip to content

Commit 2cfb899

Browse files
authored
Use builtin data types instead of Databricks sdk types for make_table fixture (#2674)
## Changes [Pytester](https://github.com/databrickslabs/pytester) adopted simpler, i.e. built-in, data types. Changes for `make_table` fixture applied in this PR ### Linked issues Resolves #2672 Resolves #2671 ### Tests - [x] modified integration tests: the ones that use the `make_table` fixture
1 parent abfe380 commit 2cfb899

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/integration/hive_metastore/test_migrate.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from databricks.sdk.errors import NotFound
66
from databricks.sdk.retries import retried
77
from databricks.sdk.service.compute import DataSecurityMode, AwsAttributes
8-
from databricks.sdk.service.catalog import ColumnInfo, ColumnTypeName, Privilege, SecurableType, TableInfo, TableType
8+
from databricks.sdk.service.catalog import Privilege, SecurableType, TableInfo, TableType
99
from databricks.sdk.service.iam import PermissionLevel
1010
from databricks.labs.ucx.config import WorkspaceConfig
1111
from databricks.labs.ucx.hive_metastore.mapping import Rule, TableMapping
@@ -23,7 +23,7 @@ def test_migrate_managed_tables(ws, sql_backend, runtime_ctx, make_catalog):
2323
src_managed_table = runtime_ctx.make_table(
2424
catalog_name=src_schema.catalog_name,
2525
schema_name=src_schema.name,
26-
columns=[ColumnInfo(name="-das-hes-", type_name=ColumnTypeName.STRING)], # Test with column that needs escaping
26+
columns=[("-das-hes-", "STRING")], # Test with column that needs escaping
2727
)
2828

2929
dst_catalog = make_catalog()
@@ -55,8 +55,7 @@ def test_migrate_dbfs_non_delta_tables(ws, sql_backend, runtime_ctx, make_catalo
5555
catalog_name=src_schema.catalog_name,
5656
non_delta=True,
5757
schema_name=src_schema.name,
58-
# Test with column that needs escaping
59-
columns=[ColumnInfo(name="1-0`.0-ugly-column", type_name=ColumnTypeName.STRING)],
58+
columns=[("1-0`.0-ugly-column", "STRING")], # Test with column that needs escaping
6059
)
6160

6261
dst_catalog = make_catalog()
@@ -145,8 +144,7 @@ def test_migrate_external_table(
145144
src_external_table = runtime_ctx.make_table(
146145
schema_name=src_schema.name,
147146
external_csv=make_mounted_location,
148-
# Test with column that needs escaping
149-
columns=[ColumnInfo(name="`back`ticks`", type_name=ColumnTypeName.STRING)],
147+
columns=[("`back`ticks`", "STRING")], # Test with column that needs escaping
150148
)
151149
dst_catalog = make_catalog()
152150
dst_schema = runtime_ctx.make_schema(catalog_name=dst_catalog.name, name=src_schema.name)
@@ -680,8 +678,7 @@ def test_migrate_table_in_mount(
680678
src_external_table = runtime_ctx.make_table(
681679
schema_name=src_schema.name,
682680
external_delta=f"dbfs:/mnt/{env_or_skip('TEST_MOUNT_NAME')}/a/b/{table_path}",
683-
# Test with column that needs escaping
684-
columns=[ColumnInfo(name="1-0`.0-ugly-column", type_name=ColumnTypeName.STRING)],
681+
columns=[("1-0`.0-ugly-column", "STRING")], # Test with column that needs escaping
685682
)
686683
table_in_mount_location = f"abfss://[email protected]/a/b/{table_path}"
687684
# TODO: Remove this hack below

0 commit comments

Comments
 (0)