Skip to content

Commit

Permalink
[hotfix] Presto's latest_sub_partion rendering fail
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Apr 20, 2017
1 parent dc364da commit 938e13a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def latest_partition(cls, table_name, schema, database, show_first=False):
return part_field, cls._latest_partition_from_df(df)

@classmethod
def latest_sub_partition(cls, table_name, schema, database, **kwargs):
def latest_sub_partition(cls, table_name, schema, database, **kwargs):
"""Returns the latest (max) partition value for a table
A filtering criteria should be passed for all fields that are
Expand Down Expand Up @@ -740,7 +740,7 @@ def where_latest_partition(
return False

@classmethod
def latest_sub_partition(cls, table_name, **kwargs):
def latest_sub_partition(cls, table_name, schema, database, **kwargs):
# TODO(bogdan): implement`
pass

Expand Down
5 changes: 4 additions & 1 deletion superset/jinja_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ def latest_partition(self, table_name):
def latest_sub_partition(self, table_name, **kwargs):
table_name, schema = self._schema_table(table_name, self.schema)
return self.database.db_engine_spec.latest_sub_partition(
table_name, schema, self.database, kwargs)
table_name=table_name,
schema=schema,
database=self.database,
**kwargs)


class HiveTemplateProcessor(PrestoTemplateProcessor):
Expand Down

0 comments on commit 938e13a

Please sign in to comment.