-
Notifications
You must be signed in to change notification settings - Fork 67
do not merge: bananza mode wip #744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
a663037
68e1df6
d5e6713
14457bc
54069f2
504eb39
9a69509
8db85a6
65d1628
386f254
4d70666
36f9fa8
158572a
da22d77
57a3376
d1779f3
e0f4375
9a9a23d
a1c1c0c
cbbf530
de339fd
9fe4829
16f5226
0f182f3
bc415da
5471786
8dff561
c0bc120
30664de
34d4351
297674d
f6cc1ea
6b67ed1
cf50d64
68c5fff
597c1a5
53bb076
14b468c
103ecc7
6799539
d38423a
47aa505
836d932
5d8ae55
435e72d
3ea679a
033c1aa
f53cf29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Copyright (c) 2025 Airbyte, Inc., all rights reserved. | ||
"""PyAirbyte LakeStorage class.""" | ||
from __future__ import annotations | ||
|
||
import abc | ||
from abc import abstractproperty | ||
|
||
|
||
|
||
class LakeStorage(abc.ABC): | ||
"""PyAirbyte LakeStorage class.""" | ||
|
||
@abstractproperty | ||
|
||
def uri_protocol(self) -> str: | ||
"""Return the URI protocol for the lake storage. | ||
E.g. "file://", "s3://", "gcs://", etc. | ||
""" | ||
raise NotImplementedError("Subclasses must implement this method.") | ||
|
||
@property | ||
def root_storage_uri(self) -> str: | ||
"""Get the root URI for the lake storage.""" | ||
return f"{self.uri_protocol}{self.root_storage_path}/" | ||
|
||
@property | ||
def root_storage_path(self) -> str: | ||
"""Get the root path for the lake storage.""" | ||
return "airbyte/lake" | ||
|
||
def path_to_uri(self, path: str) -> str: | ||
"""Convert a relative lake path to a URI.""" | ||
return f"{self.root_storage_uri}{path}" | ||
|
||
def get_stream_root_path( | ||
self, | ||
stream_name: str, | ||
) -> str: | ||
"""Get the path for a stream in the lake storage.""" | ||
return f"{self.root_storage_path}/{stream_name}/" | ||
|
||
def get_stream_root_uri( | ||
self, | ||
stream_name: str, | ||
) -> str: | ||
"""Get the URI root for a stream in the lake storage.""" | ||
return self.path_to_uri(self.get_stream_root_path(stream_name)) | ||
|
||
|
||
class S3LakeStorage(LakeStorage): | ||
"""S3 Lake Storage implementation.""" | ||
|
||
def __init__(self, bucket_name: str, region: str, access_key_id: str, secret_access_key: str): | ||
"""Initialize S3LakeStorage with required parameters.""" | ||
self.bucket_name = bucket_name | ||
self.region = region | ||
self.access_key_id = access_key_id | ||
self.secret_access_key = secret_access_key | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
@property | ||
def uri_protocol(self) -> str: | ||
"""Return the URI protocol for S3.""" | ||
return "s3://" | ||
|
||
@property | ||
def root_storage_uri(self) -> str: | ||
"""Get the root URI for the S3 lake storage.""" | ||
return f"{self.uri_protocol}{self.bucket_name}/" |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,82 @@ | ||||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
"""An example script to run a fast lake copy operation using PyAirbyte. | ||||
Usage: | ||||
poetry run python examples/run_fast_lake_copy.py | ||||
Required secrets: | ||||
- SNOWFLAKE_PASSWORD: Password for Snowflake connection. | ||||
- AWS_ACCESS_KEY_ID: AWS access key ID for S3 connection. | ||||
- AWS_SECRET_ACCESS_KEY: AWS secret access key for S3 connection. | ||||
""" | ||||
from numpy import source | ||||
|
from numpy import source |
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading. Please reload this page.