This repository was archived by the owner on Apr 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
feat: Add dataframe.to_html #259
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
964568c
feat: Add dataframe.to_html
Genesis929 1eb3fb1
temp
Genesis929 51160d2
lint fix
Genesis929 795e4d4
Merge branch 'main' into huanc-to_html-b296945119
Genesis929 5bbbd9f
Merge branch 'main' into huanc-to_html-b296945119
Genesis929 69d6247
Merge branch 'main' into huanc-to_html-b296945119
Genesis929 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3463,6 +3463,15 @@ def test_df_to_string(scalars_df_index, scalars_pandas_df_index): | |
| assert bf_result == pd_result | ||
|
|
||
|
|
||
| def test_df_to_html(scalars_df_index, scalars_pandas_df_index): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a test with all the input parameters. Then if pandas changes anything such as deprecating some arguments, we may know that and modify our docs.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are way too many inputs, the test would be quite long after formatting. And on the other hand, based on how the to_html is defined on our end, if any argument is not longer available in pandas, I think an error will be raised in the test anyway, as we are passing all keyword arguments no matter whether there is an user input. |
||
| unsupported = ["numeric_col"] # formatted differently | ||
|
|
||
| bf_result = scalars_df_index.drop(columns=unsupported).to_html() | ||
| pd_result = scalars_pandas_df_index.drop(columns=unsupported).to_html() | ||
|
|
||
| assert bf_result == pd_result | ||
|
|
||
|
|
||
| def test_df_to_markdown(scalars_df_index, scalars_pandas_df_index): | ||
| # Nulls have bug from tabulate https://github.com/astanin/python-tabulate/issues/231 | ||
| bf_result = scalars_df_index.dropna().to_markdown() | ||
|
|
||
This file contains hidden or 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
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.
Prefer to cast explicitly instead of just ignore. Better readability.