-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a353c3
commit 83ab6f8
Showing
9 changed files
with
75 additions
and
87 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
13 changes: 13 additions & 0 deletions
13
example/derive_expression/expression_lib/expression_lib/_typing.py
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,13 @@ | ||
from typing import TYPE_CHECKING, Union | ||
|
||
if TYPE_CHECKING: | ||
import sys | ||
|
||
import polars as pl | ||
|
||
if sys.version_info >= (3, 10): | ||
from typing import TypeAlias | ||
else: | ||
from typing_extensions import TypeAlias | ||
|
||
IntoExpr: TypeAlias = Union[pl.Expr, str, pl.Series] |
3 changes: 3 additions & 0 deletions
3
example/derive_expression/expression_lib/expression_lib/_utils.py
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,3 @@ | ||
from pathlib import Path | ||
|
||
LIB = Path(__file__).parent |
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
14 changes: 9 additions & 5 deletions
14
example/derive_expression/expression_lib/expression_lib/panic.py
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,15 +1,19 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
import polars as pl | ||
from polars.type_aliases import IntoExpr | ||
from polars.plugins import register_plugin_function | ||
|
||
from expression_lib.utils import parse_into_expr | ||
from pathlib import Path | ||
from expression_lib._utils import LIB | ||
|
||
if TYPE_CHECKING: | ||
from expression_lib._typing import IntoExpr | ||
|
||
|
||
def panic(expr: IntoExpr) -> pl.Expr: | ||
expr = parse_into_expr(expr) | ||
return register_plugin_function( | ||
plugin_path=Path(__file__).parent, | ||
plugin_path=LIB, | ||
args=[expr], | ||
function_name="panic", | ||
) |
48 changes: 0 additions & 48 deletions
48
example/derive_expression/expression_lib/expression_lib/utils.py
This file was deleted.
Oops, something went wrong.