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

docs: update example os listing users with python client #3454

Merged
merged 6 commits into from
Jul 27, 2023
Merged

docs: update example os listing users with python client #3454

merged 6 commits into from
Jul 27, 2023

Conversation

plaguss
Copy link
Contributor

@plaguss plaguss commented Jul 25, 2023

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Closes #3453

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)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (change restructuring the codebase without changing functionality)
  • Improvement (change adding some improvement to an existing functionality)
  • Documentation update

How Has This Been Tested

(Please describe the tests that you ran to verify your changes. And ideally, reference tests)

  • Test A
  • Test B

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/)

plaguss and others added 3 commits July 27, 2023 12:41
…-basics.ipynb


The following suggestion addresses these issues:
- Listing users is limited to the role `owner`, but perhaps an `admin` might be doing the assignments.
- We want to make sure that we only make assignments to users that have access to the dataset.

Co-authored-by: Natalia Elvira <126158523+nataliaElv@users.noreply.github.com>
@nataliaElv
Copy link
Member

Sorry, one last change before approving the PR. In the block below assignments[users[idx]['username']].append(record) should change to assignments[users[idx].username].append(record) to work:

# divide your dataset in chunks of the same length as the users list and make the assignments
n = len(users)
chunked_records = [ds[i:i + n] for i in range(0, len(ds), n)]
for chunk in chunked_records:
    for idx, record in enumerate(chunk):
        assignments[users[idx]['username']].append(record)

@plaguss
Copy link
Contributor Author

plaguss commented Jul 27, 2023

No problem, that should be it then :)

@nataliaElv
Copy link
Member

Thanks for the contribution @plaguss !

@nataliaElv nataliaElv added this to the v1.14.0 milestone Jul 27, 2023
@frascuchon frascuchon merged commit e77f416 into argilla-io:develop Jul 27, 2023
9 of 10 checks passed
@nataliaElv nataliaElv mentioned this pull request Jul 27, 2023
9 tasks
leiyre pushed a commit that referenced this pull request Jul 31, 2023
* develop:
  feat: field `PATCH` endpoint (#3421)
  feat: add dataset `PATCH` endpoint (#3402)
  fix: import errors when importing from `argilla.feedback` (#3471)
  feat: bump version to `0.13.3`
  docs: update example os listing users with python client (#3454)
  docs: Resolve typos, missing import (#3443)
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.

[DOCS] Update tutorial to use python client
3 participants