diff --git a/google/colab/_generate_with_variable.py b/google/colab/_generate_with_variable.py deleted file mode 100644 index 43889218..00000000 --- a/google/colab/_generate_with_variable.py +++ /dev/null @@ -1,85 +0,0 @@ -"""Helper to generate code targeting dataframes.""" - -import uuid -import IPython - -_ICON_SVG = """ - """ - - -def get_html(dataframe) -> str: - """Returns the html to generate for a dataframe.""" - if not IPython.get_ipython(): - return "" - namespace = IPython.get_ipython().user_ns - - variable_name = None - for varname, var in namespace.items(): - if dataframe is var and not varname.startswith("_"): - variable_name = varname - break - - if not variable_name: - return "" - - button_id = "id_" + str(uuid.uuid4()) - - return """ -
- """.format( - icon=_ICON_SVG, - variable_name=variable_name, - button_id=button_id, - ) diff --git a/google/colab/_quickchart_hint_button.py b/google/colab/_quickchart_hint_button.py index e15cdd41..434b5626 100644 --- a/google/colab/_quickchart_hint_button.py +++ b/google/colab/_quickchart_hint_button.py @@ -18,7 +18,6 @@ import uuid as _uuid import weakref as _weakref -from google.colab import _generate_with_variable from google.colab import _interactive_table_hint_button from google.colab import _quickchart from google.colab import output @@ -27,7 +26,6 @@ _output_callbacks = {} _MAX_CHART_INSTANCES = 4 -_ENABLE_GENERATE = False _QUICKCHART_BUTTON_MIN_ROW_COUNT = 2 # Min # rows to enable quickchart button. _ICON_SVG = textwrap.dedent(""" @@ -261,8 +259,6 @@ def _df_formatter_with_hint_buttons(df): buttons = [] if len(df) >= _QUICKCHART_BUTTON_MIN_ROW_COUNT: buttons.append(register_df_and_get_html(df)) - if _ENABLE_GENERATE: - buttons.append(_generate_with_variable.get_html(df)) # pylint: disable=protected-access html = _interactive_table_hint_button._df_formatter_with_interactive_hint( df, buttons