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

refactor: Updated rest_api schema for tables to be consistent with Document.to_dict #3872

Merged
merged 1 commit into from
Jan 25, 2023

Conversation

sjrl
Copy link
Contributor

@sjrl sjrl commented Jan 17, 2023

Related Issues

Proposed Changes:

Updated schema in rest_api to make returned table format consistent with how it is returned when using Haystacks' Document.to_dict() (shown below)

haystack/haystack/schema.py

Lines 163 to 165 in 9e457db

# Convert pd.DataFrame to list of rows for serialization
if self.content_type == "table" and isinstance(self.content, pd.DataFrame):
v = [self.content.columns.tolist()] + self.content.values.tolist()

How did you test it?

Updated existing unit test.

Notes for the reviewer

Since this is changing the schema of the rest_api should this be labelled as a breaking change?

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added tests that demonstrate the correct behavior of the change
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test:.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

…ith how it is returned when using Haystacks' Document.to_dict().
@sjrl sjrl requested a review from a team as a code owner January 17, 2023 09:45
@sjrl sjrl requested review from mayankjobanputra and removed request for a team January 17, 2023 09:45
@sjrl
Copy link
Contributor Author

sjrl commented Jan 17, 2023

@mayankjobanputra This is ready for review! I'm not sure why the license/cla is taking so long to report, do you have any idea if we could retrigger this check?

@sjrl sjrl added topic:rest_api topic:tableQA type:refactor Not necessarily visible to the users labels Jan 17, 2023
@sjrl sjrl added type:bug Something isn't working and removed type:refactor Not necessarily visible to the users labels Jan 24, 2023
Copy link
Contributor

@mayankjobanputra mayankjobanputra left a comment

Choose a reason for hiding this comment

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

LGTM. I will merge this after we merge the version bump up PR :)

@sjrl
Copy link
Contributor Author

sjrl commented Jan 25, 2023

LGTM. I will merge this after we merge the version bump up PR :)

Just to clarify @mayankjobanputra would this not be included in the v1.13 release then?

@mayankjobanputra mayankjobanputra added this to the 1.13.0 milestone Jan 25, 2023
@mayankjobanputra mayankjobanputra merged commit fac72aa into main Jan 25, 2023
@mayankjobanputra mayankjobanputra deleted the rest-api-table-format branch January 25, 2023 17:48
ZanSara pushed a commit that referenced this pull request Jan 27, 2023
…ith how it is returned when using Haystacks' Document.to_dict(). (#3872)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table format of API search request different
2 participants