Skip to content

Commit

Permalink
Add get_sdk_info from hsfs to hopsworks init (#309)
Browse files Browse the repository at this point in the history
Also fix _prompt_project
  • Loading branch information
aversey authored Sep 3, 2024
1 parent 8da6f70 commit 572a375
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,12 @@ Documentation is available at [Hopsworks Documentation](https://docs.hopsworks.a

For general questions about the usage of Hopsworks and the Feature Store please open a topic on [Hopsworks Community](https://community.hopsworks.ai/).

Please report any issue using [Github issue tracking](https://github.com/logicalclocks/hopsworks-api/issues).

### Related to Feautre Store API

Please attach the client environment from the output below to your issue, if it is related to Feature Store API:
Please report any issue using [Github issue tracking](https://github.com/logicalclocks/hopsworks-api/issues) and attach the client environment from the output below to your issue:

```python
import hopsworks
import hsfs
hopsworks.login().get_feature_store()
print(hsfs.get_env())
hopsworks.login()
print(hopsworks.get_sdk_info())
```

## Contributing
Expand Down
8 changes: 6 additions & 2 deletions python/hopsworks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def _get_cached_api_key_path():

def _prompt_project(valid_connection, project, is_app):
if project is None:
saas_projects = valid_connection.get_projects()
saas_projects = valid_connection._project_api._get_projects()
if len(saas_projects) == 0:
if is_app:
raise ProjectException("Could not find any project")
Expand Down Expand Up @@ -355,7 +355,7 @@ def _prompt_project(valid_connection, project, is_app):
)
else:
try:
return valid_connection.get_project(project)
return valid_connection._project_api._get_project(project)
except RestAPIError as x:
raise ProjectException("Could not find project {}".format(project)) from x

Expand Down Expand Up @@ -481,3 +481,7 @@ def _set_active_project(project):

def disable_usage_logging():
usage.disable()


def get_sdk_info():
return usage.get_env()

0 comments on commit 572a375

Please sign in to comment.