Re: [PR] support SRV records in the HTTP operator [airflow]

2025-05-24 Thread via GitHub


github-actions[bot] closed pull request #48628: support SRV records in the HTTP 
operator
URL: https://github.com/apache/airflow/pull/48628


-- 
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]



Re: [PR] support SRV records in the HTTP operator [airflow]

2025-05-18 Thread via GitHub


github-actions[bot] commented on PR #48628:
URL: https://github.com/apache/airflow/pull/48628#issuecomment-2889303098

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

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



Re: [PR] support SRV records in the HTTP operator [airflow]

2025-04-03 Thread via GitHub


rawwar commented on code in PR #48628:
URL: https://github.com/apache/airflow/pull/48628#discussion_r2026643935


##
providers/http/src/airflow/providers/http/hooks/http.py:
##
@@ -172,15 +173,29 @@ def _set_base_url(self, connection: Connection) -> None:
 host = connection.host or self.default_host
 schema = connection.schema or "http"
 # RFC 3986 (https://www.rfc-editor.org/rfc/rfc3986.html#page-16)
-if "://" in host:
-self.base_url = host
-else:
-self.base_url = f"{schema}://{host}" if host else f"{schema}://"
-if connection.port:
-self.base_url = f"{self.base_url}:{connection.port}"
-parsed = urlparse(self.base_url)
-if not parsed.scheme:
-raise ValueError(f"Invalid base URL: Missing scheme in 
{self.base_url}")
+srv=str(connection.extra_dejson.get("srv", "false")).lower()
+if srv == "true":
+try:
+records = dns.resolver.resolve(host, 'SRV')
+sorted_records = sorted(records, key=lambda r: (r.priority, 
-r.weight))
+best_record = sorted_records[0]
+host = f"{best_record.target}:{best_record.port}"

Review Comment:
   @driquelme, wdyt?



-- 
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]