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

Bugfixes/align availables workspaces and set workspace operation #3263

Merged

Conversation

frascuchon
Copy link
Member

@frascuchon frascuchon commented Jun 25, 2023

Description

This PR adapts the client workflow to check available workspaces before the rg.set_workspace function. Since the set_workspace is based on list_workspaces method, a code refactor has been applied to return only available workspaces for the connected user.

@alvarobartt we need to align the User.workspaces, list_workspace, and Workspace.create

Closes #3262

Type of change

(Please delete options that are not relevant. Remember to title the PR according to the type of change)

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I added relevant documentation
  • follows the style guidelines of this project
  • I did a self-review of my code
  • I made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@codecov
Copy link

codecov bot commented Jun 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.30 🎉

Comparison is base (d143492) 90.73% compared to head (027e24a) 91.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3263      +/-   ##
==========================================
+ Coverage   90.73%   91.04%   +0.30%     
==========================================
  Files         219      219              
  Lines       11673    11681       +8     
==========================================
+ Hits        10592    10635      +43     
+ Misses       1081     1046      -35     
Flag Coverage Δ
pytest 91.04% <100.00%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/argilla/client/client.py 94.42% <100.00%> (+0.16%) ⬆️
src/argilla/client/sdk/users/api.py 96.96% <100.00%> (+0.09%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@frascuchon frascuchon linked an issue Jun 25, 2023 that may be closed by this pull request
Copy link
Member

@alvarobartt alvarobartt left a comment

Choose a reason for hiding this comment

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

LGTM, but in User there are some inconsistencies as we're not always the current User but e.g. the owner listing all the users, so workspaces listing would fail, and I wouldn't update the SDK until the mock is fixed in a separate PR. But I agree with the missing type-hints, extended unit tests, and Argilla.__init__ fixes

src/argilla/client/client.py Outdated Show resolved Hide resolved
src/argilla/client/client.py Outdated Show resolved Hide resolved
src/argilla/client/client.py Show resolved Hide resolved
src/argilla/client/sdk/users/api.py Outdated Show resolved Hide resolved
src/argilla/client/users.py Outdated Show resolved Hide resolved
src/argilla/client/users.py Outdated Show resolved Hide resolved
src/argilla/client/users.py Outdated Show resolved Hide resolved
src/argilla/client/users.py Outdated Show resolved Hide resolved
…operation' of github.com:argilla-io/argilla into bugfixes/align-availables-workspaces-and-set-workspace-operation
@frascuchon frascuchon merged commit 0d9811a into main Jun 28, 2023
16 checks passed
@frascuchon frascuchon deleted the bugfixes/align-availables-workspaces-and-set-workspace-operation branch June 28, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set workspace after create a new one
2 participants