zombie-squirrel 0.2.0__py3-none-any.whl → 0.2.1__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.
- zombie_squirrel/__init__.py +1 -1
- zombie_squirrel/acorns.py +12 -0
- zombie_squirrel/squirrels.py +2 -3
- zombie_squirrel/utils.py +0 -15
- {zombie_squirrel-0.2.0.dist-info → zombie_squirrel-0.2.1.dist-info}/METADATA +1 -1
- zombie_squirrel-0.2.1.dist-info/RECORD +10 -0
- zombie_squirrel-0.2.0.dist-info/RECORD +0 -10
- {zombie_squirrel-0.2.0.dist-info → zombie_squirrel-0.2.1.dist-info}/WHEEL +0 -0
- {zombie_squirrel-0.2.0.dist-info → zombie_squirrel-0.2.1.dist-info}/licenses/LICENSE +0 -0
- {zombie_squirrel-0.2.0.dist-info → zombie_squirrel-0.2.1.dist-info}/top_level.txt +0 -0
zombie_squirrel/__init__.py
CHANGED
zombie_squirrel/acorns.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# forest_cache/acorns.py
|
|
2
2
|
from abc import ABC, abstractmethod
|
|
3
|
+
import logging
|
|
3
4
|
import pandas as pd
|
|
4
5
|
import os
|
|
5
6
|
|
|
@@ -55,3 +56,14 @@ class MemoryAcorn(Acorn):
|
|
|
55
56
|
|
|
56
57
|
def scurry(self, table_name: str) -> pd.DataFrame:
|
|
57
58
|
return self._store.get(table_name, pd.DataFrame())
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def rds_get_handle_empty(acorn: Acorn, table_name: str) -> pd.DataFrame:
|
|
62
|
+
"""Utility function for testing purposes."""
|
|
63
|
+
try:
|
|
64
|
+
df = acorn.scurry(table_name)
|
|
65
|
+
except Exception as e:
|
|
66
|
+
logging.warning(f"Error fetching from cache: {e}")
|
|
67
|
+
df = pd.DataFrame()
|
|
68
|
+
|
|
69
|
+
return df
|
zombie_squirrel/squirrels.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"""Squirrels: functions to fetch and cache data from MongoDB."""
|
|
2
2
|
import pandas as pd
|
|
3
|
-
from typing import Any, Callable
|
|
4
|
-
from zombie_squirrel.acorns import RedshiftAcorn, MemoryAcorn
|
|
3
|
+
from typing import Any, Callable
|
|
4
|
+
from zombie_squirrel.acorns import RedshiftAcorn, MemoryAcorn, rds_get_handle_empty
|
|
5
5
|
from aind_data_access_api.document_db import MetadataDbClient
|
|
6
6
|
import os
|
|
7
7
|
import logging
|
|
8
|
-
from zombie_squirrel.utils import prefix_table_name, rds_get_handle_empty
|
|
9
8
|
|
|
10
9
|
# --- Backend setup ---------------------------------------------------
|
|
11
10
|
|
zombie_squirrel/utils.py
CHANGED
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
"""Utility functions"""
|
|
2
|
-
import pandas as pd
|
|
3
|
-
import logging
|
|
4
|
-
|
|
5
|
-
from zombie_squirrel.acorns import Acorn
|
|
6
2
|
|
|
7
3
|
|
|
8
4
|
def prefix_table_name(table_name: str) -> str:
|
|
9
5
|
return "zs_" + table_name
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def rds_get_handle_empty(acorn: Acorn, table_name: str) -> pd.DataFrame:
|
|
13
|
-
"""Utility function for testing purposes."""
|
|
14
|
-
try:
|
|
15
|
-
df = acorn.scurry(table_name)
|
|
16
|
-
except Exception as e:
|
|
17
|
-
logging.warning(f"Error fetching from cache: {e}")
|
|
18
|
-
df = pd.DataFrame()
|
|
19
|
-
|
|
20
|
-
return df
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
zombie_squirrel/__init__.py,sha256=BKo2OO2fNRtDUwp3C4OzfTmx-LNfTSQWFFvUpjc6zg4,100
|
|
2
|
+
zombie_squirrel/acorns.py,sha256=IMgsvOBCi7-ghbYN4AkeP09JVPuXsXnyogAFQJEf7vo,2073
|
|
3
|
+
zombie_squirrel/squirrels.py,sha256=z0xqsaEXgdpuI9uGJ5OD43FXX8dgVaSTwqly-O8-sEM,2600
|
|
4
|
+
zombie_squirrel/sync.py,sha256=jslTVIend5Z-sLJuNXKkhn-nqmKK_P0FAiRuFFYRnto,168
|
|
5
|
+
zombie_squirrel/utils.py,sha256=74DSFK1Qbp8yQeUXpnli4kqx_QcAc8v4_6FZut0xZ8g,103
|
|
6
|
+
zombie_squirrel-0.2.1.dist-info/licenses/LICENSE,sha256=U0Y7B3gZJHXpjJVLgTQjM8e_c8w4JJpLgGhIdsoFR1Y,1092
|
|
7
|
+
zombie_squirrel-0.2.1.dist-info/METADATA,sha256=oF9a5lwgVSuOoLdyoydjmuu98R3pQXeeXsKbcuU8Ng0,1382
|
|
8
|
+
zombie_squirrel-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
zombie_squirrel-0.2.1.dist-info/top_level.txt,sha256=FmM0coe4AangURZLjM4JwwRv2B8H6oINYCoZLKLDCKA,16
|
|
10
|
+
zombie_squirrel-0.2.1.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
zombie_squirrel/__init__.py,sha256=WIIsssyoZM4omZBRGKAl8z__7RkYNFY9CBg-IPRLdDU,100
|
|
2
|
-
zombie_squirrel/acorns.py,sha256=-iRFY_BzkQcU90NfxFIElHRTs3arFm4ai0HQ6QuKlrU,1758
|
|
3
|
-
zombie_squirrel/squirrels.py,sha256=M5P5PfMqpP2KkABnIqz13LVdNXqru-TwLPs5IXUZfmM,2662
|
|
4
|
-
zombie_squirrel/sync.py,sha256=jslTVIend5Z-sLJuNXKkhn-nqmKK_P0FAiRuFFYRnto,168
|
|
5
|
-
zombie_squirrel/utils.py,sha256=_Dun_8gsFM_6DbacrRe3NCh-iE9JZayu_Rk4EJAtzUk,480
|
|
6
|
-
zombie_squirrel-0.2.0.dist-info/licenses/LICENSE,sha256=U0Y7B3gZJHXpjJVLgTQjM8e_c8w4JJpLgGhIdsoFR1Y,1092
|
|
7
|
-
zombie_squirrel-0.2.0.dist-info/METADATA,sha256=7w1PBQwbXrOTokM5ISrd8_Za9pnWjG63hGnUWBTfA4A,1382
|
|
8
|
-
zombie_squirrel-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
-
zombie_squirrel-0.2.0.dist-info/top_level.txt,sha256=FmM0coe4AangURZLjM4JwwRv2B8H6oINYCoZLKLDCKA,16
|
|
10
|
-
zombie_squirrel-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|