Skip to content

Commit

Permalink
mitosheet: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondr77 committed Oct 2, 2024
1 parent 5688ee2 commit e539deb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions mitosheet/mitosheet/dataframe_display_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
For a more thorough explanation of attempted solutions, see the comment here: https://github.com/mito-ds/mito/pull/1330#issuecomment-2386428760
"""

def set_dataframe_display_formatters():
def set_dataframe_display_formatters() -> None:
try:
# Since Mito is used in Streamlit which is not a iPython enviornment,
# we just wrap this entire thing in a try, except statement
Expand All @@ -52,13 +52,13 @@ def mitosheet_plain_formatter(obj, p, cycle):
return '' # Prevent default text representation
return None # Let other types use the default formatter

ip = get_ipython()
ip = get_ipython() # type: ignore
html_formatter = ip.display_formatter.formatters['text/html']
plain_formatter = ip.display_formatter.formatters['text/plain']

# Save the original formatters
set_dataframe_display_formatters.original_html_formatter = html_formatter.for_type(pd.DataFrame)
set_dataframe_display_formatters.original_plain_formatter = plain_formatter.for_type(pd.DataFrame)
set_dataframe_display_formatters.original_html_formatter = html_formatter.for_type(pd.DataFrame) # type: ignore
set_dataframe_display_formatters.original_plain_formatter = plain_formatter.for_type(pd.DataFrame) # type: ignore

# Register the custom formatters
html_formatter.for_type(pd.DataFrame, mitosheet_display_formatter)
Expand Down
2 changes: 1 addition & 1 deletion mitosheet/src/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function activateMitosheetExtension(
return;
}

let codeCell = getCellAtIndex(cells, mimeRenderInputCellIndex + 1)
const codeCell = getCellAtIndex(cells, mimeRenderInputCellIndex + 1)
const codeCellText = getCellText(codeCell);

if (codeCell === undefined) {
Expand Down

0 comments on commit e539deb

Please sign in to comment.