-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
155 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
try: | ||
from importlib.metadata import entry_points # type:ignore | ||
except ImportError: # pragma: no cover | ||
from importlib_metadata import entry_points # type:ignore | ||
|
||
|
||
def register_plugins(): | ||
for plugin in entry_points().get("fugue.plugins", []): | ||
try: | ||
register_func = plugin.load() | ||
assert callable(register_func), f"{plugin.name} is not a callable" | ||
register_func() | ||
except ImportError: # pragma: no cover | ||
pass | ||
|
||
|
||
register_plugins() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# flake8: noqa | ||
from fugue_ibis.execution import pandas_backend | ||
from fugue_ibis.execution.ibis_engine import IbisEngine | ||
from fugue_ibis.extensions import run_ibis, as_ibis, as_fugue | ||
from fugue_ibis.execution.ibis_engine import IbisEngine, register_ibis_engine | ||
from fugue_ibis.execution.pandas_backend import _to_pandas_ibis_engine | ||
from fugue_ibis.extensions import as_fugue, as_ibis, run_ibis | ||
|
||
|
||
def register(): | ||
register_ibis_engine(1, _to_pandas_ibis_engine) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.6.5" | ||
__version__ = "0.6.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from fugue import FugueWorkflow | ||
from fugue_sql import fsql | ||
|
||
|
||
def test_importless(): | ||
for engine in ["dask"]: | ||
dag = FugueWorkflow() | ||
dag.df([[0]], "a:int").show() | ||
|
||
dag.run(engine) | ||
|
||
fsql( | ||
""" | ||
CREATE [[0],[1]] SCHEMA a:int | ||
SELECT * WHERE a<1 | ||
""" | ||
).run(engine) | ||
|
||
dag = FugueWorkflow() | ||
idf = dag.df([[0], [1]], "a:int").as_ibis() | ||
idf[idf.a < 1].as_fugue().show() | ||
|
||
dag.run(engine) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from fugue import FugueWorkflow | ||
from fugue_sql import fsql | ||
|
||
|
||
def test_importless(): | ||
for engine in ["duck", "duckdb"]: | ||
dag = FugueWorkflow() | ||
dag.df([[0]], "a:int").show() | ||
|
||
dag.run(engine) | ||
|
||
fsql( | ||
""" | ||
CREATE [[0],[1]] SCHEMA a:int | ||
SELECT * WHERE a<1 | ||
""" | ||
).run(engine) | ||
|
||
dag = FugueWorkflow() | ||
idf = dag.df([[0], [1]], "a:int").as_ibis() | ||
idf[idf.a < 1].as_fugue().show() | ||
|
||
dag.run(engine) | ||
|
||
dag = FugueWorkflow() | ||
tdf = dag.df([[0], [1]], "a:int") | ||
dag.select("SELECT * FROM ", tdf, " WHERE a<1", sql_engine=engine) | ||
|
||
dag.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from fugue import FugueWorkflow | ||
|
||
|
||
def test_importless(): | ||
for engine in [None]: | ||
dag = FugueWorkflow() | ||
idf = dag.df([[0], [1]], "a:int").as_ibis() | ||
idf[idf.a < 1].as_fugue().show() | ||
|
||
dag.run(engine) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from fugue import FugueWorkflow | ||
from fugue_sql import fsql | ||
from pyspark.sql import SparkSession | ||
|
||
|
||
def test_importless(): | ||
spark = SparkSession.builder.getOrCreate() | ||
for engine in [spark, "spark"]: | ||
dag = FugueWorkflow() | ||
dag.df([[0]], "a:int").show() | ||
|
||
dag.run(engine) | ||
|
||
fsql( | ||
""" | ||
CREATE [[0],[1]] SCHEMA a:int | ||
SELECT * WHERE a<1 | ||
""" | ||
).run(engine) | ||
|
||
dag = FugueWorkflow() | ||
idf = dag.df([[0], [1]], "a:int").as_ibis() | ||
idf[idf.a < 1].as_fugue().show() | ||
|
||
dag.run(engine) |