Skip to content

Commit

Permalink
release 0.4.5 (#98)
Browse files Browse the repository at this point in the history
* release 0.4.5

* fix native execution engine datetime issue

* add release notes
  • Loading branch information
goodwanghan committed Nov 6, 2020
1 parent 3a8eea5 commit 1f4d3a4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ pre-commit install

## Update History

### 0.4.5

* [Extension validation](https://github.com/fugue-project/fugue/issues/81) interface and interfaceless syntax
* Passing dataframes cross workflow ([yield](https://github.com/fugue-project/fugue/pull/94))
* [OUT TRANSFORM](https://github.com/fugue-project/fugue/issues/82) to transform and finish a branch of execution
* Fixed a PandasDataFrame datetime [issue](https://github.com/fugue-project/triad/issues/59) that only happened in transformer interface approach

### 0.4.3

* Unified checkpoints and persist
Expand Down
5 changes: 5 additions & 0 deletions fugue/execution/native_execution_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ def map(
df = to_local_df(df)
cursor.set(df.peek_array(), 0, 0)
output_df = map_func(cursor, df)
if (
isinstance(output_df, PandasDataFrame)
and output_df.schema != output_schema
):
output_df = PandasDataFrame(output_df.native, output_schema)
assert_or_throw(
output_df.schema == output_schema,
f"map output {output_df.schema} mismatches given {output_schema}",
Expand Down
26 changes: 18 additions & 8 deletions fugue_test/builtin_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,13 +863,30 @@ def test_col_ops(self):
a[["x"]].rename(x="xx").assert_eq(ArrayDataFrame([[1], [2]], "xx:long"))

def test_datetime_in_workflow(self):
# schema: a:date,b:datetime
def t1(df: pd.DataFrame) -> pd.DataFrame:
df["b"] = "2020-01-02"
df["b"] = pd.to_datetime(df["b"])
return df

class T2(Transformer):
def get_output_schema(self, df):
return df.schema

def transform(self, df):
# test for issue https://github.com/fugue-project/fugue/issues/92
return PandasDataFrame(df.as_pandas())

with self.dag() as dag:
a = dag.df([["2020-01-01"]], "a:date").transform(transform_datetime_df)
a = dag.df([["2020-01-01"]], "a:date").transform(t1)
b = dag.df(
[[datetime.date(2020, 1, 1), datetime.datetime(2020, 1, 2)]],
"a:date,b:datetime",
)
b.assert_eq(a)
c = dag.df([["2020-01-01", "2020-01-01 00:00:00"]], "a:date,b:datetime")
c.transform(T2).assert_eq(c)
c.partition(by=["a"]).transform(T2).assert_eq(c)

@pytest.fixture(autouse=True)
def init_tmpdir(self, tmpdir):
Expand Down Expand Up @@ -1189,10 +1206,3 @@ def mock_co_tf4_ex(df1: List[Dict[str, Any]], p=1) -> List[List[Any]]:
if k == 2:
raise NotImplementedError
return [[df1[0]["a"], len(df1), p]]


# schema: a:date,b:datetime
def transform_datetime_df(df: pd.DataFrame) -> pd.DataFrame:
df["b"] = "2020-01-02"
df["b"] = pd.to_datetime(df["b"])
return df
2 changes: 1 addition & 1 deletion fugue_version/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.3"
__version__ = "0.4.5"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
keywords="distributed spark dask sql dsl domain specific language",
url="http://github.com/fugue-project/fugue",
install_requires=[
"triad>=0.4.3",
"triad>=0.4.5",
"adagio>=0.2.2",
"qpd>=0.2.4",
"sqlalchemy",
Expand Down

0 comments on commit 1f4d3a4

Please sign in to comment.