You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/16 06:36:04 UTC

[GitHub] [iceberg] Fokko commented on a diff in pull request #5542: Fix linter and test failures

Fokko commented on code in PR #5542:
URL: https://github.com/apache/iceberg/pull/5542#discussion_r946383986


##########
python/tests/catalog/test_hive.py:
##########
@@ -468,7 +468,7 @@ def test_list_namespaces():
 
 
 def test_list_namespaces_with_parent():
-    catalog = HiveCatalog(HIVE_CATALOG_NAME, {}, uri=HIVE_METASTORE_FAKE_URL)
+    catalog = HiveCatalog(name=HIVE_CATALOG_NAME, properties={}, uri=HIVE_METASTORE_FAKE_URL)

Review Comment:
   We can just omit properties since we just now use the `kwargs` as the properties. This makes it a bit more flexible to configure the different catalogs



##########
python/tests/catalog/test_hive.py:
##########
@@ -468,7 +468,7 @@ def test_list_namespaces():
 
 
 def test_list_namespaces_with_parent():
-    catalog = HiveCatalog(HIVE_CATALOG_NAME, {}, uri=HIVE_METASTORE_FAKE_URL)
+    catalog = HiveCatalog(name=HIVE_CATALOG_NAME, properties={}, uri=HIVE_METASTORE_FAKE_URL)

Review Comment:
   ```suggestion
       catalog = HiveCatalog(HIVE_CATALOG_NAME, uri=HIVE_METASTORE_FAKE_URL)
   ```



##########
python/pyiceberg/catalog/rest.py:
##########
@@ -268,7 +268,7 @@ def _split_identifier_for_json(self, identifier: Union[str, Identifier]) -> Dict
             raise NoSuchTableError(f"Missing namespace or invalid identifier: {identifier_tuple}")
         return {"namespace": identifier_tuple[:-1], "name": identifier_tuple[-1]}
 
-    def _handle_non_200_response(self, exc: HTTPError, error_handler: Dict[int, Type[Exception]]):
+    def _handle_non_200_response(self, exc: HTTPError, error_handler: Dict[int, Type[Exception]]):  # noqa: C901

Review Comment:
   ```suggestion
       def _handle_non_200_response(self, exc: HTTPError, error_handler: Dict[int, Type[Exception]]):
   ```



##########
python/pyiceberg/cli/console.py:
##########
@@ -260,7 +260,7 @@ def properties():
 @click.argument("identifier")
 @click.argument("property_name", required=False)
 @click.pass_context
-def get(ctx: Context, entity: Literal["name", "namespace", "table"], identifier: str, property_name: str):
+def get(ctx: Context, entity: Literal["name", "namespace", "table"], identifier: str, property_name: str):  # noqa: C901

Review Comment:
   ```suggestion
   def get(ctx: Context, entity: Literal["name", "namespace", "table"], identifier: str, property_name: str):
   ```



##########
python/tests/catalog/test_rest.py:
##########
@@ -157,7 +157,7 @@ def test_list_namespace_with_parent_200(rest_mock: Mocker):
         json={"namespaces": [["tax"]]},
         status_code=200,
     )
-    assert RestCatalog("rest", {}, TEST_URI, token=TEST_TOKEN).list_namespaces(("accounting",)) == [
+    assert RestCatalog(name="rest", properties="", uri=TEST_URI, token=TEST_TOKEN).list_namespaces(("accounting",)) == [

Review Comment:
   ```suggestion
       assert RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).list_namespaces(("accounting",)) == [
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org