prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add ssl extra arguments to postgres hook
  This enables one to specify items such as ssl certificate paths in the extra field of a postgres connection object. Rather than simply pass-through everything from the extra field, I followed the existing code pattern of selecting for specific arguments, as demonstrated in other hooks. I tested this in Python 2.7.6 and Python 2.7.10.
  
  
  </issue>
  <code>
  [start of airflow/hooks/postgres_hook.py]
  1 import psycopg2
  2 
  3 from airflow.hooks.dbapi_hook import DbApiHook
  4 
  5 
  6 class PostgresHook(DbApiHook):
  7     '''
  8     Interact with Postgres.
  9     '''
  10     conn_name_attr = 'postgres_conn_id'
  11     default_conn_name = 'postgres_default'
  12     supports_autocommit = True
  13 
  14     def get_conn(self):
  15         conn = self.get_connection(self.postgres_conn_id)
  16         return psycopg2.connect(
  17             host=conn.host,
  18             user=conn.login,
  19             password=conn.password,
  20             dbname=conn.schema,
  21             port=conn.port)
  22
  [end of airflow/hooks/postgres_hook.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/airflow/hooks/postgres_hook.py b/airflow/hooks/postgres_hook.py
  --- a/airflow/hooks/postgres_hook.py
  +++ b/airflow/hooks/postgres_hook.py
  @@ -6,6 +6,8 @@
   class PostgresHook(DbApiHook):
       '''
       Interact with Postgres.
  +    You can specify ssl parameters in the extra field of your connection
  +    as ``{"sslmode": "require", "sslcert": "/path/to/cert.pem", etc}``.
       '''
       conn_name_attr = 'postgres_conn_id'
       default_conn_name = 'postgres_default'
  @@ -13,9 +15,14 @@
   
       def get_conn(self):
           conn = self.get_connection(self.postgres_conn_id)
  -        return psycopg2.connect(
  +        conn_args = dict(
               host=conn.host,
               user=conn.login,
               password=conn.password,
               dbname=conn.schema,
               port=conn.port)
  +        # check for ssl parameters in conn.extra
  +        for arg_name, arg_val in conn.extra_dejson.items():
  +            if arg_name in ['sslmode', 'sslcert', 'sslkey', 'sslrootcert', 'sslcrl']:
  +                conn_args[arg_name] = arg_val
  +        return psycopg2.connect(**conn_args)
  
verification_info: {"golden_diff": "diff --git a/airflow/hooks/postgres_hook.py b/airflow/hooks/postgres_hook.py\n--- a/airflow/hooks/postgres_hook.py\n+++ b/airflow/hooks/postgres_hook.py\n@@ -6,6 +6,8 @@\n class PostgresHook(DbApiHook):\n     '''\n     Interact with Postgres.\n+    You can specify ssl parameters in the extra field of your connection\n+    as ``{\"sslmode\": \"require\", \"sslcert\": \"/path/to/cert.pem\", etc}``.\n     '''\n     conn_name_attr = 'postgres_conn_id'\n     default_conn_name = 'postgres_default'\n@@ -13,9 +15,14 @@\n \n     def get_conn(self):\n         conn = self.get_connection(self.postgres_conn_id)\n-        return psycopg2.connect(\n+        conn_args = dict(\n             host=conn.host,\n             user=conn.login,\n             password=conn.password,\n             dbname=conn.schema,\n             port=conn.port)\n+        # check for ssl parameters in conn.extra\n+        for arg_name, arg_val in conn.extra_dejson.items():\n+            if arg_name in ['sslmode', 'sslcert', 'sslkey', 'sslrootcert', 'sslcrl']:\n+                conn_args[arg_name] = arg_val\n+        return psycopg2.connect(**conn_args)\n", "issue": "Add ssl extra arguments to postgres hook\nThis enables one to specify items such as ssl certificate paths in the extra field of a postgres connection object. Rather than simply pass-through everything from the extra field, I followed the existing code pattern of selecting for specific arguments, as demonstrated in other hooks. I tested this in Python 2.7.6 and Python 2.7.10.\n\n", "before_files": [{"content": "import psycopg2\n\nfrom airflow.hooks.dbapi_hook import DbApiHook\n\n\nclass PostgresHook(DbApiHook):\n    '''\n    Interact with Postgres.\n    '''\n    conn_name_attr = 'postgres_conn_id'\n    default_conn_name = 'postgres_default'\n    supports_autocommit = True\n\n    def get_conn(self):\n        conn = self.get_connection(self.postgres_conn_id)\n        return psycopg2.connect(\n            host=conn.host,\n            user=conn.login,\n            password=conn.password,\n            dbname=conn.schema,\n            port=conn.port)\n", "path": "airflow/hooks/postgres_hook.py"}]}