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

Unresponsive hyperlink to access Argilla dashboard in argilla v1.4.0 #2527

Closed
anammari opened this issue Mar 14, 2023 · 3 comments · Fixed by #2543
Closed

Unresponsive hyperlink to access Argilla dashboard in argilla v1.4.0 #2527

anammari opened this issue Mar 14, 2023 · 3 comments · Fixed by #2543
Assignees
Labels
type: bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@anammari
Copy link

anammari commented Mar 14, 2023

Bug description:
Just reporting an issue with the hyperlink that is generated in Jupyter notebooks to access the Argilla dashboard when writing a new Argilla dataset. The hyperlink does not work with me in the new Argilla version v1.4.0 (it doesn't respond to user clicks) but is working fine in the older version (v.1.3.0).

To Reproduce:

  1. pip install argilla==1.4.0
  2. Open Jupyter notebook and add code to write an Argilla dataset to the dashboard.

Example:


import argilla as rg

# get the label strings to turn int ids into string names
labels = banking_ds["test"].features["label"].names

records = []
for example in test_ds_with_preds:
    # create a record with ground-truth annotations and gpt-3 predictions
    record = rg.TextClassificationRecord(
        inputs={"text": example["text"], "explanation": example["explanation"]},
        annotation=labels[example["label"]],
        prediction=[(example["prediction"].lower(), 1.0)]
    )
    records.append(record)

# create a dataset in Argilla
rg.log(records, "banking_sentiment_zs_gpt3")

  1. Execute the code cell in Jupyter.
  2. The generated hyperlink in the output to access the Argilla dashboard does not respond to user clicks.

Expected behavior:
The generated hyperlink in the output to access the Argilla dashboard should open a new browser tab with the Argilla dashboard.

Screenshots:
image

Environment:

  • OS: Linux
  • Browser: Chrome, Edge
  • Argilla Version: v1.4.0:
  • Docker Images:
  1. Jupyter: https://huggingface.co/spaces/aammari/jupyter-stacks-voila/blob/main/Dockerfile
  2. Argilla: https://huggingface.co/spaces/aammari/ndis-nlp-data-validation/blob/main/Dockerfile
@anammari anammari added the type: bug Indicates an unexpected problem or unintended behavior label Mar 14, 2023
@tomaarsen
Copy link
Contributor

tomaarsen commented Mar 14, 2023

@anammari I appreciate your detailed report!

This is caused by #2350, i.e. the move to use rich its print method rather than the default print. Why exactly the rich printed URLs are not clickable: I'm not sure. I suspect that Jupyter notebooks override the default print behaviour to include the opportunity to click the link. I can't find an issue for this on the rich repo I'm afraid.

We only use the rich print in exactly one place in the codebase:

rprint(f"{processed} records logged to {self._client.base_url}/datasets/{workspace}/{name}")

A potential solution is to rely on the default print if we detect that users are using a Jupyter Notebook environment, as that one is already sufficient in that environment, and only use the rich print in the terminal.
I'm open to hear your thoughts.

cc: @frascuchon

@frascuchon
Copy link
Member

frascuchon commented Mar 14, 2023

Okay. These lines are working from a jupyter notebook:

from rich import print
print("Visit my [link=https://www.willmcgugan.com]blog[/link]!")

We should adapt our link message to this format

@frascuchon frascuchon added this to the v1.5.0 milestone Mar 14, 2023
@tomaarsen
Copy link
Contributor

Very smart. I can make that happen first thing in the morning tomorrow if you'd like.

@tomaarsen tomaarsen self-assigned this Mar 15, 2023
frascuchon pushed a commit that referenced this issue Mar 15, 2023
…ebooks (#2543)

Closes #2527

Hello!

## Pull Request overview
* Print via the recommended [link
syntax](https://rich.readthedocs.io/en/stable/markup.html#links).

## Details
See #2527 for details on the issue at hand. This PR allows the link to
work in Jupyter notebooks again.

---

**Type of change**

- [x] Bug fix (non-breaking change which fixes an issue)

**How Has This Been Tested**

Manual verification that the URL is clickable both in a Jupyter Notebook
environment and in the terminal.

**Checklist**

- [x] I have merged the original branch into my forked branch
- [ ] I added relevant documentation
- [x] follows the style guidelines of this project
- [x] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---

- Tom Aarsen
frascuchon added a commit that referenced this issue Mar 22, 2023
## [1.5.0](v1.4.0...v1.5.0) -
2023-03-21

### Added

- Add the fields to retrieve when loading the data from argilla.
`rg.load` takes too long because of the vector field, even when users
don't need it. Closes
[#2398](#2398)
- Add new page and components for dataset settings. Closes
[#2442](#2003)
- Add ability to show image in records (for TokenClassification and
TextClassification) if an URL is passed in metadata with the key
\_image_url
- Non-searchable fields support in metadata.
[#2570](#2570)

### Changed

- Labels are now centralized in a specific vuex ORM called GlobalLabel
Model, see #2210. This model
is the same for TokenClassification and TextClassification (so both task
have labels with color_id and shortcuts parameters in the vuex ORM)
- The shortcuts improvement for labels
[#2339](#2339) have been moved
to the vuex ORM in dataset settings feature
[#2444](eb37c3b)
- Update "Define a labeling schema" section in docs.
- The record inputs are sorted alphabetically in UI by default.
[#2581](#2581)

### Fixes

- Allow URL to be clickable in Jupyter notebook again. Closes
[#2527](#2527)

### Removed

- Removing some data scan deprecated endpoints used by old clients. This
change will break compatibility with client `<v1.3.0`
- Stop using old scan deprecated endpoints in python client. This logic
will break client compatibility with server version `<1.3.0`
- Remove the previous way to add labels through the dataset page. Now
labels can be added only through dataset settings page.



### As always, thanks to our amazing contributors!
- Documentation update: tutorial for text classification models
comparison (#2426) by @embonhomme
- Docs: fix little typo (#2522) by @anakin87
- Docs: Tutorial on image classification (#2420) by @burtenshaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants