databrickslabs / pytester

Python Testing for Databricks
https://pypi.org/project/databricks-labs-pytester/
Other
51 stars 5 forks source link

Release v0.1.0 #38

Closed nfx closed 1 month ago

nfx commented 1 month ago

Dependency updates:

github-actions[bot] commented 1 month ago

This PR breaks backwards compatibility for databrickslabs/lsql downstream. See build logs for more details.

Running from downstreams #5

github-actions[bot] commented 1 month ago

This PR breaks backwards compatibility for databrickslabs/blueprint downstream. See build logs for more details.

Running from downstreams #5

github-actions[bot] commented 1 month ago

❌ 26/27 passed, 1 failed, 3 skipped, 2m7s total

❌ test_permissions_for_redash: AttributeError: 'str' object has no attribute 'value' (5.332s) ``` AttributeError: 'str' object has no attribute 'value' [gw8] linux -- Python 3.10.14 /home/runner/work/pytester/pytester/.venv/bin/python 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created dummy-dc6j-ra78a5304a@example.com: https://DATABRICKS_HOST/#settings/workspace/identity-and-access/users/4818718868036841 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added workspace user fixture: User(active=True, display_name='dummy-dc6j-ra78a5304a@example.com', emails=[ComplexValue(display=None, primary=True, ref=None, type='work', value='dummy-dc6j-ra78a5304a@example.com')], entitlements=[], external_id=None, groups=[], id='4818718868036841', name=Name(family_name=None, given_name='dummy-dc6j-ra78a5304a@example.com'), roles=[], schemas=[, ], user_name='dummy-dc6j-ra78a5304a@example.com') 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created hive_metastore.dummy_syyan schema: https://DATABRICKS_HOST/#explore/data/hive_metastore/dummy_syyan 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added schema fixture: SchemaInfo(browse_only=None, catalog_name='hive_metastore', catalog_type=None, comment=None, created_at=None, created_by=None, effective_predictive_optimization_flag=None, enable_predictive_optimization=None, full_name='hive_metastore.dummy_syyan', metastore_id=None, name='dummy_syyan', owner=None, properties=None, schema_id=None, storage_location=None, storage_root=None, updated_at=None, updated_by=None) 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created hive_metastore.dummy_syyan.ucx_tsj2l schema: https://DATABRICKS_HOST/#explore/data/hive_metastore/dummy_syyan/ucx_tsj2l 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added table fixture: TableInfo(access_point=None, browse_only=None, catalog_name='hive_metastore', columns=None, comment=None, created_at=None, created_by=None, data_access_configuration_id=None, data_source_format=, deleted_at=None, delta_runtime_properties_kvpairs=None, effective_predictive_optimization_flag=None, enable_predictive_optimization=None, encryption_details=None, full_name='hive_metastore.dummy_syyan.ucx_tsj2l', metastore_id=None, name='ucx_tsj2l', owner=None, pipeline_id=None, properties={'RemoveAfter': '2024091722'}, row_filter=None, schema_name='dummy_syyan', sql_path=None, storage_credential_name=None, storage_location='dbfs:/user/hive/warehouse/dummy_syyan/ucx_tsj2l', table_constraints=None, table_id=None, table_type=, updated_at=None, updated_by=None, view_definition=None, view_dependencies=None) 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created dummy_query_QKwON_ra78a5304a query: https://DATABRICKS_HOST/#sql/editor/85992f5e-11be-47e7-ba71-9a76232bc903 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added query fixture: LegacyQuery(can_edit=None, created_at='2024-09-17T20:35:11Z', data_source_id=None, description='TEST QUERY FOR UCX', id='85992f5e-11be-47e7-ba71-9a76232bc903', is_archived=False, is_draft=False, is_favorite=False, is_safe=True, last_modified_by=User(email='0a330eb5-dd51-4d97-b6e4-c474356b1d5d', id=481119220561874, name='labs-account-admin-identity'), last_modified_by_id=None, latest_query_data_id=None, name='dummy_query_QKwON_ra78a5304a', options=QueryOptions(catalog=None, moved_to_trash_at=None, parameters=[], schema=None), parent='folders/4279257340449065', permission_tier=None, query='SELECT * FROM hive_metastore.dummy_syyan.ucx_tsj2l', query_hash=None, run_as_role=, tags=['original_query_tag'], updated_at='2024-09-17T20:35:12Z', user=User(email='0a330eb5-dd51-4d97-b6e4-c474356b1d5d', id=481119220561874, name='labs-account-admin-identity'), user_id=481119220561874, visualizations=[LegacyVisualization(created_at='2024-09-17T20:35:11Z', description='', id='67c1e7b2-6df4-4807-bca0-21baddeb7144', name='Results', options={'version': 2}, query=None, type='TABLE', updated_at='2024-09-17T20:35:11Z')]) 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created dummy-dc6j-ra78a5304a@example.com: https://DATABRICKS_HOST/#settings/workspace/identity-and-access/users/4818718868036841 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added workspace user fixture: User(active=True, display_name='dummy-dc6j-ra78a5304a@example.com', emails=[ComplexValue(display=None, primary=True, ref=None, type='work', value='dummy-dc6j-ra78a5304a@example.com')], entitlements=[], external_id=None, groups=[], id='4818718868036841', name=Name(family_name=None, given_name='dummy-dc6j-ra78a5304a@example.com'), roles=[], schemas=[, ], user_name='dummy-dc6j-ra78a5304a@example.com') 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created hive_metastore.dummy_syyan schema: https://DATABRICKS_HOST/#explore/data/hive_metastore/dummy_syyan 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added schema fixture: SchemaInfo(browse_only=None, catalog_name='hive_metastore', catalog_type=None, comment=None, created_at=None, created_by=None, effective_predictive_optimization_flag=None, enable_predictive_optimization=None, full_name='hive_metastore.dummy_syyan', metastore_id=None, name='dummy_syyan', owner=None, properties=None, schema_id=None, storage_location=None, storage_root=None, updated_at=None, updated_by=None) 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created hive_metastore.dummy_syyan.ucx_tsj2l schema: https://DATABRICKS_HOST/#explore/data/hive_metastore/dummy_syyan/ucx_tsj2l 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added table fixture: TableInfo(access_point=None, browse_only=None, catalog_name='hive_metastore', columns=None, comment=None, created_at=None, created_by=None, data_access_configuration_id=None, data_source_format=, deleted_at=None, delta_runtime_properties_kvpairs=None, effective_predictive_optimization_flag=None, enable_predictive_optimization=None, encryption_details=None, full_name='hive_metastore.dummy_syyan.ucx_tsj2l', metastore_id=None, name='ucx_tsj2l', owner=None, pipeline_id=None, properties={'RemoveAfter': '2024091722'}, row_filter=None, schema_name='dummy_syyan', sql_path=None, storage_credential_name=None, storage_location='dbfs:/user/hive/warehouse/dummy_syyan/ucx_tsj2l', table_constraints=None, table_id=None, table_type=, updated_at=None, updated_by=None, view_definition=None, view_dependencies=None) 20:35 INFO [databricks.labs.pytester.fixtures.baseline] Created dummy_query_QKwON_ra78a5304a query: https://DATABRICKS_HOST/#sql/editor/85992f5e-11be-47e7-ba71-9a76232bc903 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] added query fixture: LegacyQuery(can_edit=None, created_at='2024-09-17T20:35:11Z', data_source_id=None, description='TEST QUERY FOR UCX', id='85992f5e-11be-47e7-ba71-9a76232bc903', is_archived=False, is_draft=False, is_favorite=False, is_safe=True, last_modified_by=User(email='0a330eb5-dd51-4d97-b6e4-c474356b1d5d', id=481119220561874, name='labs-account-admin-identity'), last_modified_by_id=None, latest_query_data_id=None, name='dummy_query_QKwON_ra78a5304a', options=QueryOptions(catalog=None, moved_to_trash_at=None, parameters=[], schema=None), parent='folders/4279257340449065', permission_tier=None, query='SELECT * FROM hive_metastore.dummy_syyan.ucx_tsj2l', query_hash=None, run_as_role=, tags=['original_query_tag'], updated_at='2024-09-17T20:35:12Z', user=User(email='0a330eb5-dd51-4d97-b6e4-c474356b1d5d', id=481119220561874, name='labs-account-admin-identity'), user_id=481119220561874, visualizations=[LegacyVisualization(created_at='2024-09-17T20:35:11Z', description='', id='67c1e7b2-6df4-4807-bca0-21baddeb7144', name='Results', options={'version': 2}, query=None, type='TABLE', updated_at='2024-09-17T20:35:11Z')]) 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] clearing 0 query permissions fixtures 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] clearing 1 query fixtures 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] removing query fixture: LegacyQuery(can_edit=None, created_at='2024-09-17T20:35:11Z', data_source_id=None, description='TEST QUERY FOR UCX', id='85992f5e-11be-47e7-ba71-9a76232bc903', is_archived=False, is_draft=False, is_favorite=False, is_safe=True, last_modified_by=User(email='0a330eb5-dd51-4d97-b6e4-c474356b1d5d', id=481119220561874, name='labs-account-admin-identity'), last_modified_by_id=None, latest_query_data_id=None, name='dummy_query_QKwON_ra78a5304a', options=QueryOptions(catalog=None, moved_to_trash_at=None, parameters=[], schema=None), parent='folders/4279257340449065', permission_tier=None, query='SELECT * FROM hive_metastore.dummy_syyan.ucx_tsj2l', query_hash=None, run_as_role=, tags=['original_query_tag'], updated_at='2024-09-17T20:35:12Z', user=User(email='0a330eb5-dd51-4d97-b6e4-c474356b1d5d', id=481119220561874, name='labs-account-admin-identity'), user_id=481119220561874, visualizations=[LegacyVisualization(created_at='2024-09-17T20:35:11Z', description='', id='67c1e7b2-6df4-4807-bca0-21baddeb7144', name='Results', options={'version': 2}, query=None, type='TABLE', updated_at='2024-09-17T20:35:11Z')]) 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] clearing 1 table fixtures 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] removing table fixture: TableInfo(access_point=None, browse_only=None, catalog_name='hive_metastore', columns=None, comment=None, created_at=None, created_by=None, data_access_configuration_id=None, data_source_format=, deleted_at=None, delta_runtime_properties_kvpairs=None, effective_predictive_optimization_flag=None, enable_predictive_optimization=None, encryption_details=None, full_name='hive_metastore.dummy_syyan.ucx_tsj2l', metastore_id=None, name='ucx_tsj2l', owner=None, pipeline_id=None, properties={'RemoveAfter': '2024091722'}, row_filter=None, schema_name='dummy_syyan', sql_path=None, storage_credential_name=None, storage_location='dbfs:/user/hive/warehouse/dummy_syyan/ucx_tsj2l', table_constraints=None, table_id=None, table_type=, updated_at=None, updated_by=None, view_definition=None, view_dependencies=None) 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] clearing 1 schema fixtures 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] removing schema fixture: SchemaInfo(browse_only=None, catalog_name='hive_metastore', catalog_type=None, comment=None, created_at=None, created_by=None, effective_predictive_optimization_flag=None, enable_predictive_optimization=None, full_name='hive_metastore.dummy_syyan', metastore_id=None, name='dummy_syyan', owner=None, properties=None, schema_id=None, storage_location=None, storage_root=None, updated_at=None, updated_by=None) 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] clearing 1 workspace user fixtures 20:35 DEBUG [databricks.labs.pytester.fixtures.baseline] removing workspace user fixture: User(active=True, display_name='dummy-dc6j-ra78a5304a@example.com', emails=[ComplexValue(display=None, primary=True, ref=None, type='work', value='dummy-dc6j-ra78a5304a@example.com')], entitlements=[], external_id=None, groups=[], id='4818718868036841', name=Name(family_name=None, given_name='dummy-dc6j-ra78a5304a@example.com'), roles=[], schemas=[, ], user_name='dummy-dc6j-ra78a5304a@example.com') [gw8] linux -- Python 3.10.14 /home/runner/work/pytester/pytester/.venv/bin/python ```

Running from acceptance #45