zhongjiajie commented on a change in pull request #7802: Make airflow/providers
pylint compatible
URL: https://github.com/apache/airflow/pull/7802#discussion_r396102390
##########
File path: airflow/providers/apache/pinot/hooks/pinot.py
##########
@@ -66,28 +68,45 @@ def __init__(self,
def get_conn(self):
return self.conn
- def add_schema(self, schema_file, exec=True):
+ def add_schema(self, schema_file: str, with_exec: Optional[bool] = True):
+ """
+ Add Pinot schema by run AddSchema command
+
+ :param schema_file: Pinot schema file
+ :type schema_file: str
+ :param with_exec: bool
+ :type with_exec: Optional[bool]
+ """
cmd = ["AddSchema"]
cmd += ["-controllerHost", self.host]
cmd += ["-controllerPort", self.port]
cmd += ["-schemaFile", schema_file]
- if exec:
+ if with_exec:
cmd += ["-exec"]
self.run_cli(cmd)
- def add_table(self, file_path, exec=True):
+ def add_table(self, file_path: str, with_exec: Optional[bool] = True):
+ """
+ Add Pinot table with run AddTable command
+
+ :param file_path: Pinot table configure file
+ :type file_path: str
+ :param with_exec: bool
+ :type with_exec: Optional[bool]
+ """
cmd = ["AddTable"]
cmd += ["-controllerHost", self.host]
cmd += ["-controllerPort", self.port]
cmd += ["-filePath", file_path]
- if exec:
+ if with_exec:
cmd += ["-exec"]
self.run_cli(cmd)
+ # pylint: disable=too-many-arguments
def create_segment(self,
generator_config_file=None,
data_dir=None,
- format=None,
+ format=None, # pylint: disable=redefined-builtin
Review comment:
Refactor
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services