philipgray commented on code in PR #34666:
URL: https://github.com/apache/airflow/pull/34666#discussion_r1340559993


##########
airflow/providers/databricks/hooks/databricks.py:
##########
@@ -69,6 +69,10 @@
 
 SPARK_VERSIONS_ENDPOINT = ("GET", "api/2.0/clusters/spark-versions")
 
+CREATE_REPO_ENDPOINT = ("POST", "api/2.0/repos")
+DELETE_REPO_ENDPOINT = ("DELETE", "api/2.0/repos/{repo_id}")
+UPDATE_REPO_ENDPOINT = ("PATCH", "api/2.0/repos/{repo_id}")

Review Comment:
   > Why do you need to define them as tuple then create a lambda to transform 
them? You can just create a method/some methods to return these values.
   
   I just figured we wanted to maintain some consistency with the other 
constants, and felt like it might be confusing if we had something like 
`CREATE_REPO_ENDPOINT_HEADER` and `CREATE_REPO_ENDPOINT_ROUTE` which would 
clash. 
   
   I don't think I fully understand your question though, are you suggesting we 
just have a function as opposed to lambda? i.e. 
   ```python
   
   def modify_route(route: tuple, repo_id: str) -> tuple:
       header = route[0]
       route = route[1].format(repo_id=repo_id)
       return (header, route)
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to