Skip to content

Commit 57d8503

Browse files
committed
Add support for Python 3.9
Replace usage of '|' with Union.
1 parent aa902e6 commit 57d8503

File tree

5 files changed

+615
-676
lines changed

5 files changed

+615
-676
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
13+
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
1414
steps:
1515
- uses: actions/checkout@v3
1616
- name: Set up Python ${{ matrix.python-version }}

gemmapy/_validators.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
@author: omancarci
77
"""
88

9-
import typing as T
109
import base64
1110
import gzip
1211

12+
from typing import List, Union, Optional
13+
1314
def compress_arg(arg:str):
1415
if arg is not None:
1516
return base64.b64encode(gzip.compress(arg.encode())).decode()
16-
else:
17+
else:
1718
return arg
1819

1920
def remove_nones(**kwargs):
@@ -23,19 +24,19 @@ def remove_nones(**kwargs):
2324
out.pop(k)
2425
return out
2526

26-
def add_to_filter(filt:T.Optional[str], prop: str, terms: T.List[T.Union[str,int]]):
27+
def add_to_filter(filt: Optional[str], prop: str,
28+
terms: Optional[List[Union[str, int]]]):
2729
if terms is None:
2830
return filt
29-
30-
31+
3132
if filt is None:
3233
filt = ""
33-
34+
3435
if len(filt)>0:
3536
filt = filt + " and "
36-
37+
3738
filt = filt + prop + " in (" + ",".join([str(x) for x in terms]) + ")"
38-
39+
3940
return filt
4041

4142

0 commit comments

Comments
 (0)