Skip to content

Commit

Permalink
#114 Fixed issues found in a review
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Apr 24, 2024
1 parent 5c1e049 commit d9f3a28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions exasol/bucketfs/_buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def udf_path(self) -> str:
if self._service_name is None:
raise BucketFsError('The bucket cannot provide its udf_path '
'as the service name is unknown.')
return f'buckets/{self._service_name}/{self._name}'
return f'/buckets/{self._service_name}/{self._name}'

@property
def _auth(self) -> HTTPBasicAuth:
Expand Down Expand Up @@ -262,14 +262,11 @@ def __init__(self, url: str, account_id: str, database_id: str, pat: str) -> Non

@property
def name(self) -> str:
# TODO: Find out the name of the bucket in SaaS
return 'default'

@property
def udf_path(self) -> str:
# TODO: Find out the name of the service in SaaS
# and how the udf path is constructed. Below is just a guess.
return f'buckets/bfsdefault/{self.name}'
return f'/buckets/uploads/{self.name}'

def files(self) -> Iterable[str]:
"""To be provided"""
Expand Down Expand Up @@ -317,7 +314,7 @@ def __init__(self,
if base_path:
self.root = Path(base_path)
else:
self.root = Path('buckets') / service_name / bucket_name
self.root = Path('/buckets') / service_name / bucket_name

@property
def name(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion exasol/bucketfs/_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def as_uri(self) -> str:
return self._path.as_uri()

def as_udf_path(self) -> str:
return self._bucket_api.udf_path
return str(PurePath(self._bucket_api.udf_path) / self._path)

def exists(self) -> bool:
return self._navigate() is not None
Expand Down

0 comments on commit d9f3a28

Please sign in to comment.