kaxil commented on a change in pull request #4350: [AIRFLOW-3527] Cloud SQL
Proxy has shorter path for UNIX socket
URL: https://github.com/apache/incubator-airflow/pull/4350#discussion_r244884738
##########
File path: airflow/contrib/hooks/gcp_sql_hook.py
##########
@@ -749,18 +754,39 @@ def _validate_inputs(self):
self._check_ssl_file(self.sslcert, "sslcert")
self._check_ssl_file(self.sslkey, "sslkey")
self._check_ssl_file(self.sslrootcert, "sslrootcert")
+ if self.use_proxy and not self.sql_proxy_use_tcp:
+ if self.database_type == 'postgres':
+ suffix = "/.s.PGSQL.5432"
+ else:
+ suffix = ""
+ expected_path = "{}/{}:{}:{}{}".format(
+ self._generate_unique_path(),
+ self.project_id, self.instance,
+ self.database, suffix)
+ if len(expected_path) > UNIX_PATH_MAX:
+ self.log.info("Too long ({}) path:
{}".format(len(expected_path),
Review comment:
please change it to `%s` format
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services