Skip to content

Commit cbd566a

Browse files
committed
Case conditions
1 parent 3a9d231 commit cbd566a

28 files changed

+386
-144
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3+
## 0.10.0 : 2021-11-30
4+
5+
- **Feature**: `Case` introduced (without docs, there was no time, sry, let's call it Easter Egg for a while)
6+
37
## 0.9.1 : 2021-07-20
48

5-
- **Fix**: Fixed problem with multiple properites in operations (I had to remove comparison property check)
9+
- **Fix**: Fixed problem with multiple properties in operations (I had to remove comparison property check)
610

711
## 0.9.0 : 2021-06-25
812

duckql/functions/avg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
from ..properties import Constant
1010
from ..properties.property import Property
1111
from ..structures.cast_operator import CastOperator
12+
from ..structures.case import Case
1213

1314

1415
class Avg(BaseFunction):
1516
obj: Literal['functions.Avg'] = 'functions.Avg'
16-
property: Union[Property, BaseFunction, Constant, CastOperator]
17+
property: Union[Property, BaseFunction, Constant, CastOperator, Case]
1718
alias: str = None
1819

1920
def to_sql(self) -> str:

duckql/functions/concat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
from ..properties.property import Property
1010
from ..properties.constant import Constant
1111
from ..structures.cast_operator import CastOperator
12+
from ..structures.case import Case
1213

1314

1415
class Concat(BaseFunction):
1516
obj: Literal['functions.Concat'] = 'functions.Concat'
16-
properties: List[Union[Property, BaseFunction, Constant, CastOperator]]
17+
properties: List[Union[Property, BaseFunction, Constant, CastOperator, Case]]
1718
alias: str = None
1819

1920
def to_sql(self) -> str:

duckql/functions/convert_timezone.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
from ..properties.constant import Constant
1010
from ..properties.property import Property
1111
from ..structures.cast_operator import CastOperator
12+
from ..structures.case import Case
1213

1314

1415
class ConvertTimezone(BaseFunction):
1516
obj: Literal['functions.ConvertTimezone'] = 'functions.ConvertTimezone'
16-
property: Union[Property, BaseFunction, Constant, CastOperator]
17+
property: Union[Property, BaseFunction, Constant, CastOperator, Case]
1718
date_from: Constant
1819
date_to: Constant
1920
alias: str = None

duckql/functions/count.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
from ..properties.property import Property
1111
from ..structures.cast_operator import CastOperator
1212
from ..structures.distinct import Distinct
13+
from ..structures.case import Case
1314

1415

1516
class Count(BaseFunction):
1617
obj: Literal['functions.Count'] = 'functions.Count'
17-
property: Union[Property, BaseFunction, Constant, CastOperator, Distinct]
18+
property: Union[Property, BaseFunction, Constant, CastOperator, Distinct, Case]
1819
alias: str = None
1920

2021
def to_sql(self) -> str:

duckql/functions/date_add.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
from ..properties.property import Property
1111
from ..structures.cast_operator import CastOperator
1212
from ..structures.interval import Interval
13+
from ..structures.case import Case
1314

1415

1516
class DateAdd(BaseFunction):
1617
obj: Literal['functions.DateAdd'] = 'functions.DateAdd'
17-
property: Union[Constant, Property, BaseFunction, CastOperator]
18+
property: Union[Constant, Property, BaseFunction, CastOperator, Case]
1819
interval: Interval
1920
alias: str = None
2021

duckql/functions/date_format.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
from ..properties.property import Property
1212
from ..properties.constant import Constant
1313
from ..structures.cast_operator import CastOperator
14+
from ..structures.case import Case
1415

1516

1617
class DateFormat(BaseFunction):
1718
obj: Literal['functions.DateFormat'] = 'functions.DateFormat'
18-
property: Union[Property, Constant, BaseFunction, CastOperator]
19+
property: Union[Property, Constant, BaseFunction, CastOperator, Case]
1920
format: str
2021
alias: str = None
2122

duckql/functions/date_sub.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
from ..properties.property import Property
1111
from ..structures.cast_operator import CastOperator
1212
from ..structures.interval import Interval
13+
from ..structures.case import Case
1314

1415

1516
class DateSub(BaseFunction):
1617
obj: Literal['functions.DateSub'] = 'functions.DateSub'
17-
property: Union[Constant, Property, BaseFunction, CastOperator]
18+
property: Union[Constant, Property, BaseFunction, CastOperator, Case]
1819
interval: Interval
1920
alias: str = None
2021

duckql/functions/extract.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ..properties.property import Property
1212
from ..structures.cast_operator import CastOperator
1313
from ..structures.interval import Interval
14+
from ..structures.case import Case
1415

1516

1617
class Extract(BaseFunction):
@@ -38,7 +39,7 @@ class Unit(Enum):
3839
YEAR = 'year'
3940

4041
obj: Literal['functions.Extract'] = 'functions.Extract'
41-
property: Union[Constant, Property, BaseFunction, Interval, CastOperator]
42+
property: Union[Constant, Property, BaseFunction, Interval, CastOperator, Case]
4243
unit: Unit
4344
alias: str = None
4445

duckql/functions/group_concat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
from ..properties.constant import Constant
1010
from ..properties.property import Property
1111
from ..structures.cast_operator import CastOperator
12+
from ..structures.case import Case
1213

1314

1415
class GroupConcat(BaseFunction):
1516
obj: Literal['functions.GroupConcat'] = 'functions.GroupConcat'
16-
property: Union[Constant, Property, BaseFunction, CastOperator]
17+
property: Union[Constant, Property, BaseFunction, CastOperator, Case]
1718
alias: str = None
1819

1920
def to_sql(self) -> str:

0 commit comments

Comments
 (0)