[ 
https://issues.apache.org/jira/browse/AIRFLOW-2910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16833472#comment-16833472
 ] 

ASF GitHub Bot commented on AIRFLOW-2910:
-----------------------------------------

mik-laj commented on pull request #5239: [WIP][AIRFLOW-2910] Add HTTP URI 
support
URL: https://github.com/apache/airflow/pull/5239
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
     - https://issues.apache.org/jira/browse/AIRFLOW-2910
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI 
changes:
   
   Setting up an HTTP connection is not intuitive.  This PR introduces support 
for a different connection URI format.
   Related discusion: 
   https://issues.apache.org/jira/browse/AIRFLOW-2910
   CC: @ashb @potiuk 
   
   When this solution is accepted, it will update the documentation.
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - All the public functions and the classes in the PR contain docstrings 
that explain what it does
     - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   
 
----------------------------------------------------------------
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]


> models.Connection cannot use https
> ----------------------------------
>
>                 Key: AIRFLOW-2910
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2910
>             Project: Apache Airflow
>          Issue Type: Bug
>            Reporter: isaac martin
>            Priority: Major
>
> The SimpleHttpOperator, and anything else relying on 
> airlfow.models.Connection, cannot make use of https due to what appears to be 
> a bug in the way it parses user-provided urls. The bug ends up replacing any 
> https uri with an http uri.
> To reproduce:
>  * Create a new airflow implementation.
>  * Set a connection environment var: 
> AIRFLOW_CONN_ETL_API=[https://yourdomain.com|https://yourdomain.com/]
>  * Instantiate a SimpleHttpOperator which uses the above for its http_conn_id 
> argument.
>  * Notice with horror that your requests are made to http://yourdomain.com
> To fix:
> Proposal 1
> Line 590 of airflow.models.py assigns nothing to Connection.schema. 
> Change:
> self.schema = temp_uri.path[1:]
> to
> self.schema = temp_uri[0]
>  
> Proposal 2:
> Line 40 or airflow.hooks.http_hook.py starts a block which tries to set the 
> base_url. We could add a new elif which checks self.conn_type, as 
> self.conn_type is correctly populated with 'https'.
> For example:
> elif conn.conn_type:
>     self.base_url = conn.conn_type + "://" + conn.host



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to