Skip to content

Conversation

@harishkesavarao
Copy link
Contributor

Databricks SQL Sensor.

@boring-cyborg
Copy link

boring-cyborg bot commented Apr 2, 2023

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 (ruff, mypy and type annotations). Our pre-commits 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 Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment 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 for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    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

@harishkesavarao
Copy link
Contributor Author

@alexott @bilalaslamseattle @janvandervegt @o-nikolas @josh-fell - thank you for taking the time to review my PR. I have made all the changes requested for PR #30204 here. I had to open a new one because of GitHub handles. Can you please review once more and confirm if the changes look good? Thank you!

@alexott
Copy link
Contributor

alexott commented Apr 2, 2023

@potiuk @josh-fell it looks like there are problems with Docker auth - is this error critical?

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small changes are necessary + comments from Bilal

@potiuk
Copy link
Member

potiuk commented Apr 2, 2023

@potiuk @josh-fell it looks like there are problems with Docker auth - is this error critical?

Not sure if critical but for sure intermittent (and likely a failure on GitHub size). Rebase should attempt to re-run the job.

@harishkesavarao
Copy link
Contributor Author

small changes are necessary + comments from Bilal

@alexott @bilalaslamseattle I have made all the changes requested. Can you please review again?

Copy link

@bilalaslamseattle bilalaslamseattle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harishkesavarao harishkesavarao force-pushed the db-sql-sensor branch 2 times, most recently from d58fd51 to f297270 Compare April 3, 2023 21:11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the naming convention, it's better if we use _get_hook without @cached_property or if we rename the method to hook which is the name of the property. WDYT? (I prefer renaming it to hook)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for

@cached_property
def hook(self) -> DatabricksSqlHook:
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this file change intended as part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't part of the change. It got added when I rebased the PR with main.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josh-fell not sure why it keeps happening, every time I rebase my branch with main, it keeps adding new files to my PR. Any suggestions to remove them and keep only my files?

Copy link
Member

@potiuk potiuk Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you do some mistake when rebasing. But what it is, hard to say. You can follow the "--rebase" pattern - it should not add files. You can use the GitHub UI to rebase (eaasier) or command line (more powerful and more arcane for those who are not used to git cli): see "How to Rebase" section https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#id14

I recommend to learn and master the CLI version, once you get used to doing it and do it often, it gets into a habit. Also things like liquidprompt or oh-my-zsh and friends help a lot with seeing the status of your git repo in the command prompt are immensely helpful to see if you are doing it right. Usually rebase should result with only your commits that should be pushed on top of the current master.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @potiuk, I rebased from the UI a few times and I am not sure what went wrong. I can clean things up and open a new PR if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@potiuk I had the same problem 4 days ago (#29913), I had to clean it locally then force push.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah seems liek a recurring issue last few days https://apache-airflow.slack.com/archives/CCPRP7943/p1680639118757579 - created an issue in GitHub Support for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for letting me know @potiuk. Is there a remediation path to resolve the extra files in the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will follow what @hussein-awala did to clean this up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still leftovers of unrelated changes that needs to be cleaned

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both the DatabrickSqlHook and DatabricksSqlOperator are both in "databricks_sql.py" files, probably makes sense to keep the file name convention for this new sensor file as well. Even though it's borderline non-compliant with AIP-21, consistency is probably worth having given they all deal with the same service.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it to databricks_sql.py to keep it consistent with the hook and operator files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise AirflowException("Both HTTP Path and SQL warehouse name are not specified.")
raise AirflowException("Databricks SQL warehouse/cluster configuration missing. Please specify either http_path or sql_warehouse_name.")

The current exception might be misleading to some users. It reads as though both http_path and sql_warehouse_name need to be specified. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, added the change.

@harishkesavarao
Copy link
Contributor Author

@hussein-awala @josh-fell pushed changes based on PR comments, can you please review again? Thank you for your review!

@harishkesavarao harishkesavarao deleted the db-sql-sensor branch April 5, 2023 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants