Skip to content

Commit c2e9763

Browse files
committed
Refactor imports and update dependencies; remove unused AWS storage options methods
1 parent cee12be commit c2e9763

File tree

5 files changed

+59
-50
lines changed

5 files changed

+59
-50
lines changed

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ authors = [{name = "Volker L.", email = "[email protected]"}]
33
dependencies = [
44
"sf-hamilton[visualization]>=1.69.0",
55
"python-dotenv>=1.0.1",
6-
"fsspec>=2024.5.0",
6+
"fsspec>=2024.10.0",
77
"pyyaml>=6.0.1",
88
"typer>=0.12.3",
99
"rich>=13.9.3",
@@ -13,6 +13,7 @@ dependencies = [
1313
"pendulum>=3.0.0",
1414
"tqdm>=4.67.1",
1515
"pydantic>=2.10.2",
16+
"s3fs>=2024.10.0",
1617
]
1718
description = "A simple workflow framework. Hamilton + APScheduler = FlowerPower"
1819
keywords = [
@@ -111,5 +112,6 @@ dev-dependencies = [
111112
"asyncpg>=0.30.0",
112113
"paho-mqtt>=2.1.0",
113114
"greenlet>=3.1.1",
115+
"obstore>=0.3.0",
114116
]
115117
managed = true

src/flowerpower/io/base.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -94,49 +94,6 @@ def model_post_init(self, __context):
9494
.rstrip("/")
9595
)
9696

97-
# def _update_storage_options_from_aws_credentials(
98-
# self,
99-
# profile: str = "default",
100-
# allow_invalid_certificates: bool = False,
101-
# allow_http: bool = False,
102-
# ) -> AwsStorageOptions:
103-
# if isinstance(self.storage_options, AwsStorageOptions):
104-
# self.storage_options = self.storage_options.to_aws_credentials(
105-
# profile=profile,
106-
# allow_invalid_certificates=allow_invalid_certificates,
107-
# allow_http=allow_http,
108-
# )
109-
# self._update_fs()
110-
111-
# def _update_storage_options_from_env(
112-
# self,
113-
# ):
114-
# protocol = get_protocol(self.path)
115-
# if protocol == "s3":
116-
# self.storage_options = AwsStorageOptions.from_env()
117-
# elif protocol == "gs" or protocol == "gcs":
118-
# self.storage_options = GcsStorageOptions.from_env()
119-
# elif protocol == "az" or protocol == "abfs":
120-
# self.storage_options = AzureStorageOptions.from_env()
121-
# elif protocol == "github":
122-
# self.storage_options = GitHubStorageOptions.from_env()
123-
# elif protocol == "gitlab":
124-
# self.storage_options = GitLabStorageOptions.from_env()
125-
# self._update_fs()
126-
127-
# def _update_storage_options(self, **kwargs):
128-
# self.storage_options = self.storage_options.model_copy(update=kwargs)
129-
# self._update_fs()
130-
131-
# def _update_fs(self):
132-
# if self.fs is None:
133-
# self.fs = get_filesystem(
134-
# path=self.path if isinstance(self.path, str) else self.path[0],
135-
# storage_options=self.storage_options,
136-
# fs=self.fs,
137-
# dirfs=False,
138-
# )
139-
14097
@property
14198
def _path(self):
14299
if self.fs.protocol == "dir":

src/flowerpower/io/saver/deltatable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import polars as pl
55
import pandas as pd
66
from typing import Any
7-
from ..utils.misc import _dict_to_dataframe
7+
from ...utils.misc import _dict_to_dataframe
88

99

1010
class DeltaTableWriter:

src/flowerpower/utils/filesystem/ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ def write_parquet(
880880
Returns:
881881
(pq.FileMetaData): Parquet file metadata.
882882
"""
883-
if isinstance(data, dict | list[dict]):
883+
if isinstance(data, (dict | list)):
884884
data = _dict_to_dataframe(data)
885885

886886
if isinstance(data, pl.LazyFrame):

uv.lock

Lines changed: 54 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)