fugue 0.9.0.dev2__py3-none-any.whl → 0.9.0.dev4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fugue/collections/sql.py +1 -1
- fugue/dataframe/utils.py +4 -18
- fugue/test/plugins.py +11 -1
- {fugue-0.9.0.dev2.dist-info → fugue-0.9.0.dev4.dist-info}/METADATA +11 -8
- {fugue-0.9.0.dev2.dist-info → fugue-0.9.0.dev4.dist-info}/RECORD +20 -20
- {fugue-0.9.0.dev2.dist-info → fugue-0.9.0.dev4.dist-info}/WHEEL +1 -1
- fugue_dask/_io.py +8 -5
- fugue_dask/_utils.py +4 -4
- fugue_duckdb/_io.py +1 -0
- fugue_ibis/execution_engine.py +14 -7
- fugue_ray/_constants.py +3 -4
- fugue_ray/_utils/dataframe.py +10 -21
- fugue_ray/_utils/io.py +36 -13
- fugue_ray/execution_engine.py +1 -2
- fugue_test/builtin_suite.py +14 -15
- fugue_test/dataframe_suite.py +3 -4
- fugue_test/execution_suite.py +130 -123
- {fugue-0.9.0.dev2.dist-info → fugue-0.9.0.dev4.dist-info}/LICENSE +0 -0
- {fugue-0.9.0.dev2.dist-info → fugue-0.9.0.dev4.dist-info}/entry_points.txt +0 -0
- {fugue-0.9.0.dev2.dist-info → fugue-0.9.0.dev4.dist-info}/top_level.txt +0 -0
fugue_test/builtin_suite.py
CHANGED
|
@@ -56,7 +56,6 @@ from fugue import (
|
|
|
56
56
|
from fugue.column import col
|
|
57
57
|
from fugue.column import functions as ff
|
|
58
58
|
from fugue.column import lit
|
|
59
|
-
from fugue.dataframe.utils import _df_eq as df_eq
|
|
60
59
|
from fugue.exceptions import (
|
|
61
60
|
FugueInterfacelessError,
|
|
62
61
|
FugueWorkflowCompileError,
|
|
@@ -81,7 +80,7 @@ class BuiltInTests(object):
|
|
|
81
80
|
class Tests(ft.FugueTestSuite):
|
|
82
81
|
def test_workflows(self):
|
|
83
82
|
a = FugueWorkflow().df([[0]], "a:int")
|
|
84
|
-
df_eq(a.compute(self.engine), [[0]], "a:int")
|
|
83
|
+
self.df_eq(a.compute(self.engine), [[0]], "a:int")
|
|
85
84
|
|
|
86
85
|
def test_create_show(self):
|
|
87
86
|
with FugueWorkflow() as dag:
|
|
@@ -1690,7 +1689,7 @@ class BuiltInTests(object):
|
|
|
1690
1689
|
""",
|
|
1691
1690
|
x=sdf3,
|
|
1692
1691
|
).run()
|
|
1693
|
-
df_eq(
|
|
1692
|
+
self.df_eq(
|
|
1694
1693
|
res["res"],
|
|
1695
1694
|
[[3, 4, 13]],
|
|
1696
1695
|
schema="a:long,b:int,c:long",
|
|
@@ -1723,9 +1722,9 @@ class BuiltInTests(object):
|
|
|
1723
1722
|
df1 = pd.DataFrame([[0, 1], [2, 3]], columns=["a b", " "])
|
|
1724
1723
|
df2 = pd.DataFrame([[0, 10], [20, 3]], columns=["a b", "d"])
|
|
1725
1724
|
r = fa.inner_join(df1, df2, as_fugue=True)
|
|
1726
|
-
df_eq(r, [[0, 1, 10]], "`a b`:long,` `:long,d:long", throw=True)
|
|
1725
|
+
self.df_eq(r, [[0, 1, 10]], "`a b`:long,` `:long,d:long", throw=True)
|
|
1727
1726
|
r = fa.transform(r, tr)
|
|
1728
|
-
df_eq(
|
|
1727
|
+
self.df_eq(
|
|
1729
1728
|
r,
|
|
1730
1729
|
[[0, 1, 10, 2]],
|
|
1731
1730
|
"`a b`:long,` `:long,d:long,`c *`:long",
|
|
@@ -1739,7 +1738,7 @@ class BuiltInTests(object):
|
|
|
1739
1738
|
col("d"),
|
|
1740
1739
|
col("c *").cast(int),
|
|
1741
1740
|
)
|
|
1742
|
-
df_eq(
|
|
1741
|
+
self.df_eq(
|
|
1743
1742
|
r,
|
|
1744
1743
|
[[0, 1, 10, 2]],
|
|
1745
1744
|
"`a b `:long,`x y`:long,d:long,`c *`:long",
|
|
@@ -1748,13 +1747,13 @@ class BuiltInTests(object):
|
|
|
1748
1747
|
r = fa.rename(r, {"a b ": "a b"})
|
|
1749
1748
|
fa.save(r, f_csv, header=True, force_single=True)
|
|
1750
1749
|
fa.save(r, f_parquet)
|
|
1751
|
-
df_eq(
|
|
1750
|
+
self.df_eq(
|
|
1752
1751
|
fa.load(f_parquet, columns=["x y", "d", "c *"], as_fugue=True),
|
|
1753
1752
|
[[1, 10, 2]],
|
|
1754
1753
|
"`x y`:long,d:long,`c *`:long",
|
|
1755
1754
|
throw=True,
|
|
1756
1755
|
)
|
|
1757
|
-
df_eq(
|
|
1756
|
+
self.df_eq(
|
|
1758
1757
|
fa.load(
|
|
1759
1758
|
f_csv,
|
|
1760
1759
|
header=True,
|
|
@@ -1766,7 +1765,7 @@ class BuiltInTests(object):
|
|
|
1766
1765
|
"d:str,`c *`:str",
|
|
1767
1766
|
throw=True,
|
|
1768
1767
|
)
|
|
1769
|
-
df_eq(
|
|
1768
|
+
self.df_eq(
|
|
1770
1769
|
fa.load(
|
|
1771
1770
|
f_csv,
|
|
1772
1771
|
header=True,
|
|
@@ -1786,14 +1785,14 @@ class BuiltInTests(object):
|
|
|
1786
1785
|
""",
|
|
1787
1786
|
as_fugue=True,
|
|
1788
1787
|
)
|
|
1789
|
-
df_eq(r, [[0, 1, 10]], "`a b`:long,` `:long,d:long", throw=True)
|
|
1788
|
+
self.df_eq(r, [[0, 1, 10]], "`a b`:long,` `:long,d:long", throw=True)
|
|
1790
1789
|
r = fa.fugue_sql(
|
|
1791
1790
|
"""
|
|
1792
1791
|
TRANSFORM r USING tr SCHEMA *,`c *`:long
|
|
1793
1792
|
""",
|
|
1794
1793
|
as_fugue=True,
|
|
1795
1794
|
)
|
|
1796
|
-
df_eq(
|
|
1795
|
+
self.df_eq(
|
|
1797
1796
|
r,
|
|
1798
1797
|
[[0, 1, 10, 2]],
|
|
1799
1798
|
"`a b`:long,` `:long,d:long,`c *`:long",
|
|
@@ -1805,7 +1804,7 @@ class BuiltInTests(object):
|
|
|
1805
1804
|
""",
|
|
1806
1805
|
as_fugue=True,
|
|
1807
1806
|
)
|
|
1808
|
-
df_eq(
|
|
1807
|
+
self.df_eq(
|
|
1809
1808
|
r,
|
|
1810
1809
|
[[0, 1, 10, 2]],
|
|
1811
1810
|
"`a b`:long,` `:long,d:long,`c *`:long",
|
|
@@ -1826,19 +1825,19 @@ class BuiltInTests(object):
|
|
|
1826
1825
|
f_parquet=f_parquet,
|
|
1827
1826
|
f_csv=f_csv,
|
|
1828
1827
|
).run()
|
|
1829
|
-
df_eq(
|
|
1828
|
+
self.df_eq(
|
|
1830
1829
|
res["r1"],
|
|
1831
1830
|
[[1, 10, 2]],
|
|
1832
1831
|
"`x y`:long,d:long,`c *`:long",
|
|
1833
1832
|
throw=True,
|
|
1834
1833
|
)
|
|
1835
|
-
df_eq(
|
|
1834
|
+
self.df_eq(
|
|
1836
1835
|
res["r2"],
|
|
1837
1836
|
[["1", "10", "2"]],
|
|
1838
1837
|
"`x y`:str,d:str,`c *`:str",
|
|
1839
1838
|
throw=True,
|
|
1840
1839
|
)
|
|
1841
|
-
df_eq(
|
|
1840
|
+
self.df_eq(
|
|
1842
1841
|
res["r3"],
|
|
1843
1842
|
[[0, 1, 10, 2]],
|
|
1844
1843
|
"`a b`:long,`x y`:long,d:long,`c *`:long",
|
fugue_test/dataframe_suite.py
CHANGED
|
@@ -10,7 +10,6 @@ from pytest import raises
|
|
|
10
10
|
import fugue.api as fi
|
|
11
11
|
import fugue.test as ft
|
|
12
12
|
from fugue.dataframe import ArrowDataFrame, DataFrame
|
|
13
|
-
from fugue.dataframe.utils import _df_eq as df_eq
|
|
14
13
|
from fugue.exceptions import FugueDataFrameOperationError, FugueDatasetEmptyError
|
|
15
14
|
|
|
16
15
|
|
|
@@ -121,7 +120,7 @@ class DataFrameTests(object):
|
|
|
121
120
|
assert [[1]] == fi.as_array(df, type_safe=True)
|
|
122
121
|
|
|
123
122
|
df = self.df([["a", 1, 2]], "a:str,b:int,c:int")
|
|
124
|
-
df_eq(
|
|
123
|
+
self.df_eq(
|
|
125
124
|
fi.as_fugue_df(fi.select_columns(df, ["c", "a"])),
|
|
126
125
|
[[2, "a"]],
|
|
127
126
|
"a:str,c:int",
|
|
@@ -132,13 +131,13 @@ class DataFrameTests(object):
|
|
|
132
131
|
df = self.df(data, "a:str,b:int")
|
|
133
132
|
df2 = fi.rename(df, columns=dict(a="aa"))
|
|
134
133
|
assert fi.get_schema(df) == "a:str,b:int"
|
|
135
|
-
df_eq(fi.as_fugue_df(df2), data, "aa:str,b:int", throw=True)
|
|
134
|
+
self.df_eq(fi.as_fugue_df(df2), data, "aa:str,b:int", throw=True)
|
|
136
135
|
|
|
137
136
|
for data in [[["a", 1]], []]:
|
|
138
137
|
df = self.df(data, "a:str,b:int")
|
|
139
138
|
df3 = fi.rename(df, columns={})
|
|
140
139
|
assert fi.get_schema(df3) == "a:str,b:int"
|
|
141
|
-
df_eq(fi.as_fugue_df(df3), data, "a:str,b:int", throw=True)
|
|
140
|
+
self.df_eq(fi.as_fugue_df(df3), data, "a:str,b:int", throw=True)
|
|
142
141
|
|
|
143
142
|
def test_rename_invalid(self):
|
|
144
143
|
df = self.df([["a", 1]], "a:str,b:int")
|