@@ -264,7 +264,6 @@ def test_location(catalog: InMemoryCatalog) -> None:
264264 catalog .create_table (
265265 identifier = TEST_TABLE_IDENTIFIER ,
266266 schema = TEST_TABLE_SCHEMA ,
267- location = TEST_TABLE_LOCATION ,
268267 partition_spec = TEST_TABLE_PARTITION_SPEC ,
269268 )
270269
@@ -274,6 +273,20 @@ def test_location(catalog: InMemoryCatalog) -> None:
274273 assert result .output == f"""{ DEFAULT_WAREHOUSE_LOCATION } /default/my_table\n """
275274
276275
276+ def test_location_override (catalog : InMemoryCatalog ) -> None :
277+ catalog .create_table (
278+ identifier = TEST_TABLE_IDENTIFIER ,
279+ schema = TEST_TABLE_SCHEMA ,
280+ location = TEST_TABLE_LOCATION ,
281+ partition_spec = TEST_TABLE_PARTITION_SPEC ,
282+ )
283+
284+ runner = CliRunner ()
285+ result = runner .invoke (run , ["location" , "default.my_table" ])
286+ assert result .exit_code == 0
287+ assert result .output == f"""{ TEST_TABLE_LOCATION } \n """
288+
289+
277290def test_location_does_not_exists (catalog : InMemoryCatalog ) -> None :
278291 # pylint: disable=unused-argument
279292
@@ -674,7 +687,6 @@ def test_json_location(catalog: InMemoryCatalog) -> None:
674687 catalog .create_table (
675688 identifier = TEST_TABLE_IDENTIFIER ,
676689 schema = TEST_TABLE_SCHEMA ,
677- location = TEST_TABLE_LOCATION ,
678690 partition_spec = TEST_TABLE_PARTITION_SPEC ,
679691 )
680692
@@ -684,6 +696,20 @@ def test_json_location(catalog: InMemoryCatalog) -> None:
684696 assert result .output == f'"{ DEFAULT_WAREHOUSE_LOCATION } /default/my_table"\n '
685697
686698
699+ def test_json_location_override (catalog : InMemoryCatalog ) -> None :
700+ catalog .create_table (
701+ identifier = TEST_TABLE_IDENTIFIER ,
702+ schema = TEST_TABLE_SCHEMA ,
703+ location = TEST_TABLE_LOCATION ,
704+ partition_spec = TEST_TABLE_PARTITION_SPEC ,
705+ )
706+
707+ runner = CliRunner ()
708+ result = runner .invoke (run , ["--output=json" , "location" , "default.my_table" ])
709+ assert result .exit_code == 0
710+ assert result .output == f'"{ TEST_TABLE_LOCATION } "\n '
711+
712+
687713def test_json_location_does_not_exists (catalog : InMemoryCatalog ) -> None :
688714 # pylint: disable=unused-argument
689715
0 commit comments