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

Explorer search #691

Merged
merged 13 commits into from
Nov 30, 2023
Merged

Explorer search #691

merged 13 commits into from
Nov 30, 2023

Conversation

PhilippeMoussalli
Copy link
Contributor

PR that adds search functionality to the explorer

image

other small improvements:

  • Small bugfix regarding the page navigation logic
  • Small changes to layout (short names, collapse sidebar information config)

@RobbeSneyders
Copy link
Member

Thanks @PhilippeMoussalli!

Looks good. One small request. Can we make it so pressing enter in the search box executes a search?

@PhilippeMoussalli
Copy link
Contributor Author

Thanks @PhilippeMoussalli!

Looks good. One small request. Can we make it so pressing enter in the search box executes a search?

I'v included the change. Also fixed the graphviz visualization so it looks more aligned

@RobbeSneyders
Copy link
Member

Thanks!

Two more comments:

  • Can you center the exact match / search / clear vertically?
    image

  • This specific order of actions leads to strange behavior:

    • Search for something which doesn't lead to any results
    • Move to a different tab
    • Move back to the dataset explorer

    --> The search value is reset, but the data explorer is still empty. You need to search again before you can clear it. This is only the case for searches that don't lead to any results.

filter_cache_key = hashlib.md5( # nosec
f"{search_field}_{search_value}_{exact_search}".encode(),
).hexdigest()
print(search_value)
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove these print statements.

exact_search=exact_search,
selected_fields=selected_fields,
)
print(df.compute())
Copy link
Member

Choose a reason for hiding this comment

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

Let's remove these print statements.

@PhilippeMoussalli
Copy link
Contributor Author

Thanks!

Two more comments:

  • Can you center the exact match / search / clear vertically?

There is no perfect way to fix this but It should look better now, I opted for this solution. They're not perfectly aligned but better than before

image

  • This specific order of actions leads to strange behavior:

    • Search for something which doesn't lead to any results
    • Move to a different tab
    • Move back to the dataset explorer

    --> The search value is reset, but the data explorer is still empty. You need to search again before you can clear it. This is only the case for searches that don't lead to any results.

This should be fixed now, one other strange behavior I found is that toggling the exact match on/off triggers the search even if enter is not hit. That is because streamlit refreshes on every widget event change so in this case it will detect that a text is present in the search field (even if "Enter" is not submit) and trigger the search. There is no neat way to separate the two events. I reverted back to only allowing the search via the submit button. There is an open issue to remove the "Enter to apply" placeholder to avoid confusion so we probably should do this at some point but it's not there yet.

streamlit/streamlit#7538

Copy link
Member

@RobbeSneyders RobbeSneyders left a comment

Choose a reason for hiding this comment

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

Ok, LGTM.

Only the images on the docs are broken.


![data explorer](../art/data_explorer/data_explorer.png)
![data explorer](art/data_explorer/general_overview.png)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
![data explorer](art/data_explorer/general_overview.png)
![data explorer](../art/data_explorer/general_overview.png)

- Visualize long documents using a document viewer
- Compare different pipeline runs (coming soon!)

![data explorer](art/data_explorer/dataset_explorer.png)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
![data explorer](art/data_explorer/dataset_explorer.png)
![data explorer](../art/data_explorer/dataset_explorer.png)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woops forgot to commit them. Added them, I think the existing references are valid

Copy link
Member

@RobbeSneyders RobbeSneyders left a comment

Choose a reason for hiding this comment

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

@RobbeSneyders RobbeSneyders merged commit ed05c0f into main Nov 30, 2023
6 checks passed
@RobbeSneyders RobbeSneyders deleted the explorer-search branch November 30, 2023 20:51
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.

2 participants