message: [db-engine-spec] Aligning Hive/Presto partition logic
diff: @@ -986,6 +986,7 @@ class PrestoEngineSpec(BaseEngineSpec):
  except Exception:
  # table is not partitioned
  return False
  + if value is not None:
  for c in columns:
  if c.get('name') == col_name:
  return qry.where(Column(col_name) == value)
  @@ -993,9 +994,8 @@ class PrestoEngineSpec(BaseEngineSpec):
  @classmethod
  def _latest_partition_from_df(cls, df):
  - recs = df.to_records(index=False)
  - if recs:
  - return recs[0][0]
  + if not df.empty:
  + return df.to_records(index=False)[0][0]
  @classmethod
  def latest_partition(cls, table_name, schema, database, show_first=False):
  @@ -1012,7 +1012,7 @@ class PrestoEngineSpec(BaseEngineSpec):
  :type show_first: bool
  >>> latest_partition('foo_table')
  - '2018-01-01'
  + ('ds', '2018-01-01')
  """
  indexes = database.get_indexes(table_name, schema)
  if len(indexes[0]['column_names']) < 1:
  @@ -1330,6 +1330,7 @@ class HiveEngineSpec(PrestoEngineSpec):
  except Exception:
  # table is not partitioned
  return False
  + if value is not None:
  for c in columns:
  if c.get('name') == col_name:
  return qry.where(Column(col_name) == value)
  @@ -1343,6 +1344,7 @@ class HiveEngineSpec(PrestoEngineSpec):
  @classmethod
  def _latest_partition_from_df(cls, df):
  """Hive partitions look like ds={partition name}"""
  + if not df.empty:
  return df.ix[:, 0].max().split('=')[1]
  @classmethod
  