Skip to content
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

#114 Added path builder function #115

Merged
merged 17 commits into from
Apr 24, 2024
Merged

#114 Added path builder function #115

merged 17 commits into from
Apr 24, 2024

Conversation

ahsimb
Copy link

@ahsimb ahsimb commented Apr 19, 2024

closes #114

@ahsimb ahsimb added the feature Product feature label Apr 19, 2024
@ahsimb ahsimb self-assigned this Apr 19, 2024
@ahsimb ahsimb requested review from Nicoretti and tkilias April 19, 2024 12:20
exasol/bucketfs/_buckets.py Outdated Show resolved Hide resolved
exasol/bucketfs/_path.py Outdated Show resolved Hide resolved
exasol/bucketfs/_buckets.py Show resolved Hide resolved
exasol/bucketfs/_buckets.py Outdated Show resolved Hide resolved
exasol/bucketfs/_path.py Outdated Show resolved Hide resolved
exasol/bucketfs/__init__.py Outdated Show resolved Hide resolved
exasol/bucketfs/__init__.py Outdated Show resolved Hide resolved
exasol/bucketfs/_error.py Outdated Show resolved Hide resolved
@@ -119,6 +128,7 @@ def __init__(
username: str,
password: str,
verify: bool | str = True,
service_name: Optional[str] = None
Copy link
Member

@Nicoretti Nicoretti Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add the service name this breaks separation of the layers?
(Lower layers should not now know the upper layers)

Copy link
Member

@Nicoretti Nicoretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for bringing this up late, but it seems I have missed the presence of service_name in Bucketlike. I assume that there were reasons for its implementation, but I would like to discuss this further as it may be problematic and could potentially break the abstraction of the layers.

@ahsimb
Copy link
Author

ahsimb commented Apr 24, 2024

We need to be able to implement the as_udf_path(bucket) function. For that we must know the service name. Unfortunately, we can't request the service name from the bucket, although, logically we should be able to do this. It doesn't look pretty, I agree.

@ahsimb ahsimb requested a review from Nicoretti April 24, 2024 09:07
@ahsimb ahsimb requested a review from tkilias April 24, 2024 09:07
exasol/bucketfs/_path.py Outdated Show resolved Hide resolved
@@ -272,6 +287,9 @@ def parent(self) -> str:
def as_uri(self) -> str:
return self._path.as_uri()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nicoretti @ahsimb This will be a file uri of the form file:///path/to/somewhere is this the intention

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will return 'file:///...'. Whether we need it or not, I don't know.

def __init__(self, url: str, account_id: str, database_id: str, pat: str) -> None:
self._url = url
self._account_id = account_id
self.database_id = database_id
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.database_id = database_id
self._database_id = database_id

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix when I provide an implementation for this class.

raise NotImplementedError()

def __str__(self):
return f"SaaSBucket<{self.name} | on: {self._url}>"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should include the account_id and database_id, they are necessary to identify the bucket

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both or just the database_id?

@ahsimb ahsimb merged commit 2303a7b into main Apr 24, 2024
17 checks passed
@ahsimb ahsimb deleted the feature/114-path-builder branch April 24, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a path builder
3 participants