-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix html_as_text
appearing in every element metadata
#319
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f5083bf
Missing optional LayoutElement attribute text_as_html
mpolomdeepsense e50fa9f
Only assign value to text_as_html attribute if it contains HTML tags
mpolomdeepsense bf39218
Only assign value to text_as_html attribute if it contains HTML tags
mpolomdeepsense 8834b54
Only assign value to text_as_html attribute if it contains HTML tags
mpolomdeepsense 905f082
Test format_table_elements method
mpolomdeepsense e675867
Fix lint error
mpolomdeepsense 2718780
Black formatting fix
mpolomdeepsense 670eabc
Fix line too long lint error
mpolomdeepsense 929d163
Remove text_as_html attribute from LayoutElement class
mpolomdeepsense da0a8dd
Ignore mypy attr-defined error
mpolomdeepsense File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.7.23" # pragma: no cover | ||
__version__ = "0.7.24" # pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was complaining about the missing
text_as_html
attribute when I added types toformat_table_elements
method. Since we use that attribute then I think it should be included in a class. I was also wondering whether it should go inside this class or the parentTextRegion
class.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not following this... is this coming from your test
text_as_html_attributes = [fe.text_as_html for fe in formatted_elements]
(maybe use if hasattribute(fe, "text_as_html"))?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was coming from
models.chipper.UnstructuredChipperModel.format_table_elements
method after I added types to the function definition. If there is a reason for not including it in the class then it can stay as was, I will just use thehasattribute
like you proposed. I can see that it is used like that inunstructured
repo so maybe I should just stick with that? What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to
hasattr