You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/07 07:21:24 UTC

[GitHub] [airflow] soliverr opened a new pull request #16848: Cosmetic fixes to make Spark provider work

soliverr opened a new pull request #16848:
URL: https://github.com/apache/airflow/pull/16848


   Some minmal fixes for SparkJDBCOperator and SparkSqlOperator.


-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] github-actions[bot] closed pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #16848:
URL: https://github.com/apache/airflow/pull/16848


   


-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] soliverr commented on a change in pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
soliverr commented on a change in pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#discussion_r665938459



##########
File path: airflow/providers/apache/spark/hooks/spark_sql.py
##########
@@ -152,8 +160,15 @@ def _prepare_command(self, cmd: Union[str, List[str]]) -> List[str]:
                 connection_cmd += ["-f", sql]
             else:
                 connection_cmd += ["-e", sql]
-        if self._master:
-            connection_cmd += ["--master", self._master]
+        if len(self._conn.host) > 0:

Review comment:
       Okay




-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] soliverr commented on a change in pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
soliverr commented on a change in pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#discussion_r665938100



##########
File path: airflow/providers/apache/spark/hooks/spark_jdbc.py
##########
@@ -196,6 +196,7 @@ def _resolve_jdbc_connection(self) -> Dict[str, Any]:
             conn_data['password'] = conn.password
             extra = conn.extra_dejson
             conn_data['conn_prefix'] = extra.get('conn_prefix', '')
+            conn_data['conn_suffix'] = extra.get('conn_suffix', '')

Review comment:
       It's just a proposal. For example, I have Spark JDBC connection for MS SQL Server, in which I have to specify the database' name to connect to:
   
   `jdbc:sqlserver://hostname:port;databaseName=db;`
   
   The only way to do this is to put the entire URL-string in the `Host` field of the 'Edit connection' form.
   
   So, it seems useful to add a suffix to deal with cases like this.
   




-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ashb commented on a change in pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#discussion_r665233678



##########
File path: airflow/providers/apache/spark/hooks/spark_sql.py
##########
@@ -152,8 +160,15 @@ def _prepare_command(self, cmd: Union[str, List[str]]) -> List[str]:
                 connection_cmd += ["-f", sql]
             else:
                 connection_cmd += ["-e", sql]
-        if self._master:
-            connection_cmd += ["--master", self._master]
+        if len(self._conn.host) > 0:

Review comment:
       ```suggestion
           if self._conn.host:
   ```
   
   is a more normal way of doing this -- we don't actually care about the length, so lets not compute it




-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#issuecomment-875355248


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, itโ€™s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better ๐Ÿš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] github-actions[bot] closed pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #16848:
URL: https://github.com/apache/airflow/pull/16848


   


-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ashb commented on a change in pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#discussion_r665233061



##########
File path: airflow/providers/apache/spark/hooks/spark_jdbc.py
##########
@@ -196,6 +196,7 @@ def _resolve_jdbc_connection(self) -> Dict[str, Any]:
             conn_data['password'] = conn.password
             extra = conn.extra_dejson
             conn_data['conn_prefix'] = extra.get('conn_prefix', '')
+            conn_data['conn_suffix'] = extra.get('conn_suffix', '')

Review comment:
       What is this for?




-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ashb commented on a change in pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#discussion_r665234362



##########
File path: airflow/providers/apache/spark/hooks/spark_sql.py
##########
@@ -152,8 +160,15 @@ def _prepare_command(self, cmd: Union[str, List[str]]) -> List[str]:
                 connection_cmd += ["-f", sql]
             else:
                 connection_cmd += ["-e", sql]
-        if self._master:
-            connection_cmd += ["--master", self._master]
+        if len(self._conn.host) > 0:

Review comment:
       If `self._master` is specified, that should be used over anything in the connection, otherwise you are breaking existing behaviuor.




-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] github-actions[bot] commented on pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#issuecomment-903353300


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


-- 
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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] soliverr commented on a change in pull request #16848: Cosmetic fixes to make Spark provider work

Posted by GitBox <gi...@apache.org>.
soliverr commented on a change in pull request #16848:
URL: https://github.com/apache/airflow/pull/16848#discussion_r665938459



##########
File path: airflow/providers/apache/spark/hooks/spark_sql.py
##########
@@ -152,8 +160,15 @@ def _prepare_command(self, cmd: Union[str, List[str]]) -> List[str]:
                 connection_cmd += ["-f", sql]
             else:
                 connection_cmd += ["-e", sql]
-        if self._master:
-            connection_cmd += ["--master", self._master]
+        if len(self._conn.host) > 0:

Review comment:
       Okay, I see




-- 
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: commits-unsubscribe@airflow.apache.org

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