@@ -264,7 +264,6 @@ def test_location(catalog: InMemoryCatalog) -> None:
264
264
catalog .create_table (
265
265
identifier = TEST_TABLE_IDENTIFIER ,
266
266
schema = TEST_TABLE_SCHEMA ,
267
- location = TEST_TABLE_LOCATION ,
268
267
partition_spec = TEST_TABLE_PARTITION_SPEC ,
269
268
)
270
269
@@ -274,6 +273,20 @@ def test_location(catalog: InMemoryCatalog) -> None:
274
273
assert result .output == f"""{ DEFAULT_WAREHOUSE_LOCATION } /default/my_table\n """
275
274
276
275
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
+
277
290
def test_location_does_not_exists (catalog : InMemoryCatalog ) -> None :
278
291
# pylint: disable=unused-argument
279
292
@@ -674,7 +687,6 @@ def test_json_location(catalog: InMemoryCatalog) -> None:
674
687
catalog .create_table (
675
688
identifier = TEST_TABLE_IDENTIFIER ,
676
689
schema = TEST_TABLE_SCHEMA ,
677
- location = TEST_TABLE_LOCATION ,
678
690
partition_spec = TEST_TABLE_PARTITION_SPEC ,
679
691
)
680
692
@@ -684,6 +696,20 @@ def test_json_location(catalog: InMemoryCatalog) -> None:
684
696
assert result .output == f'"{ DEFAULT_WAREHOUSE_LOCATION } /default/my_table"\n '
685
697
686
698
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
+
687
713
def test_json_location_does_not_exists (catalog : InMemoryCatalog ) -> None :
688
714
# pylint: disable=unused-argument
689
715
0 commit comments