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

[DOCS] Fix sidebar highlight by deleting subpages from the sidebar #10903

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

deborahniesz
Copy link
Contributor

@deborahniesz deborahniesz commented Jan 30, 2025

Jira Ticket

Deploy Preview

Description

We decided on deleting that wrapper customization since it was causing more bugs than fixing the only thing that we originally intended to fix:

Originally we wanted the subpages in the left sidebar to be highlighted when selected. They weren't being highlighted because they were only subtitles and not actual pages. For docusaurus to highight them we added that wrapper that also took into consideration the hash part.

But bugs like the one stated in the jira ticket started occurring so we decided to delete the "subpages" since it did not make sense to have them in the first place (we have the table of contents at the right side of the screen that was serving the exact same purpose but working properly.

  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB]
  • Code is linted - run invoke lint (uses ruff format + ruff check)
  • Appropriate tests and docs have been updated

For more information about contributing, visit our community resources.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

Copy link

netlify bot commented Jan 30, 2025

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit 515b2e3
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/679bc1bbbc12cf00081dfd4d
😎 Deploy Preview https://deploy-preview-10903.docs.greatexpectations.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 30, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
31498 1 31497 10706
View the top 1 failed tests by shortest run time
tests.datasource.fluent.integration.test_sql_datasources.TestTableIdentifiers::test_checkpoint_run[databricks_sql-py310_i413d0242e87b4ad282b9371a84dfbb65-unquoted_mixed]
Stack Traces | 5.5s run time
self = <sqlalchemy.engine.base.Connection object at 0x7f7af5cc5870>
dialect = <databricks.sqlalchemy.base.DatabricksDialect object at 0x7f7af5919900>
context = <sqlalchemy.engine.default.DefaultExecutionContext object at 0x7f7af593da20>
statement = <databricks.sqlalchemy._ddl.DatabricksStatementCompiler object at 0x7f7af5b44c10>
parameters = [{}]

    def _exec_single_context(
        self,
        dialect: Dialect,
        context: ExecutionContext,
        statement: Union[str, Compiled],
        parameters: Optional[_AnyMultiExecuteParams],
    ) -> CursorResult[Any]:
        """continue the _execute_context() method for a single DBAPI
        cursor.execute() or cursor.executemany() call.
    
        """
        if dialect.bind_typing is BindTyping.SETINPUTSIZES:
            generic_setinputsizes = context._prepare_set_input_sizes()
    
            if generic_setinputsizes:
                try:
                    dialect.do_set_input_sizes(
                        context.cursor, generic_setinputsizes, context
                    )
                except BaseException as e:
                    self._handle_dbapi_exception(
                        e, str(statement), parameters, None, context
                    )
    
        cursor, str_statement, parameters = (
            context.cursor,
            context.statement,
            context.parameters,
        )
    
        effective_parameters: Optional[_AnyExecuteParams]
    
        if not context.executemany:
            effective_parameters = parameters[0]
        else:
            effective_parameters = parameters
    
        if self._has_events or self.engine._has_events:
            for fn in self.dispatch.before_cursor_execute:
                str_statement, effective_parameters = fn(
                    self,
                    cursor,
                    str_statement,
                    effective_parameters,
                    context,
                    context.executemany,
                )
    
        if self._echo:
            self._log_info(str_statement)
    
            stats = context._get_cache_stats()
    
            if not self.engine.hide_parameters:
                self._log_info(
                    "[%s] %r",
                    stats,
                    sql_util._repr_params(
                        effective_parameters,
                        batches=10,
                        ismulti=context.executemany,
                    ),
                )
            else:
                self._log_info(
                    "[%s] [SQL parameters hidden due to hide_parameters=True]",
                    stats,
                )
    
        evt_handled: bool = False
        try:
            if context.execute_style is ExecuteStyle.EXECUTEMANY:
                effective_parameters = cast(
                    "_CoreMultiExecuteParams", effective_parameters
                )
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_executemany:
                        if fn(
                            cursor,
                            str_statement,
                            effective_parameters,
                            context,
                        ):
                            evt_handled = True
                            break
                if not evt_handled:
                    self.dialect.do_executemany(
                        cursor,
                        str_statement,
                        effective_parameters,
                        context,
                    )
            elif not effective_parameters and context.no_parameters:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_execute_no_params:
                        if fn(cursor, str_statement, context):
                            evt_handled = True
                            break
                if not evt_handled:
                    self.dialect.do_execute_no_params(
                        cursor, str_statement, context
                    )
            else:
                effective_parameters = cast(
                    "_CoreSingleExecuteParams", effective_parameters
                )
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_execute:
                        if fn(
                            cursor,
                            str_statement,
                            effective_parameters,
                            context,
                        ):
                            evt_handled = True
                            break
                if not evt_handled:
>                   self.dialect.do_execute(
                        cursor, str_statement, effective_parameters, context
                    )

.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:1964: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/default.py:942: in do_execute
    cursor.execute(statement, parameters)
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/client.py:801: in execute
    execute_response = self.thrift_backend.execute_command(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:919: in execute_command
    return self._handle_execute_response(resp, cursor)
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:1011: in _handle_execute_response
    final_operation_state = self._wait_until_command_done(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:846: in _wait_until_command_done
    self._check_command_not_in_error_or_closed_state(op_handle, poll_resp)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <databricks.sql.thrift_backend.ThriftBackend object at 0x7f7af59196f0>
op_handle = TOperationHandle(operationId=THandleIdentifier(guid=b'\x01\xef\xdf7%\x9c\x12k\xb9\xf2)fI\x1fJg', secret=b'3\x8dR\x9d\x82rF\xeb\x84\x82\xcbA\x94f\x83\x9d', executionVersion=None), operationType=0, hasResultSet=True, modifiedRowCount=None)
get_operations_resp = TGetOperationStatusResp(status=TStatus(statusCode=0, infoMessages=None, sqlState=None, errorCode=None, errorMessage=No...errorDetailsJson=None, responseValidation=None, idempotencyType=1, statementTimeout=172800, statementTimeoutLevel=None)

    def _check_command_not_in_error_or_closed_state(
        self, op_handle, get_operations_resp
    ):
        if get_operations_resp.operationState == ttypes.TOperationState.ERROR_STATE:
            if get_operations_resp.displayMessage:
>               raise ServerOperationError(
                    get_operations_resp.displayMessage,
                    {
                        "operation-id": op_handle
                        and self.guid_to_hex_id(op_handle.operationId.guid),
                        "diagnostic-info": get_operations_resp.diagnosticInfo,
                    },
                )
E               databricks.sql.exc.ServerOperationError: [INTERNAL_ERROR] Query could not be scheduled: HTTP Response code: 503. Please try again later. SQLSTATE: XX000

.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:574: ServerOperationError

The above exception was the direct cause of the following exception:

    @pytest.fixture(
        scope="class",
    )
    def table_factory() -> Generator[TableFactory, None, None]:  # noqa: C901 # FIXME CoP
        """
        Class scoped.
        Given a SQLALchemy engine, table_name and schema,
        create the table if it does not exist and drop it after the test class.
        """
        all_created_tables: dict[str, list[dict[Literal["table_name", "schema"], str | None]]] = {}
        engines: dict[str, engine.Engine] = {}
    
        def _table_factory(
            gx_engine: SqlAlchemyExecutionEngine,
            table_names: set[str],
            schema: str | None = None,
            data: Sequence[Row] = tuple(),
        ) -> None:
            sa_engine = gx_engine.engine
            if sa_engine.dialect.name in DO_NOT_CREATE_TABLES:
                LOGGER.info(f"Skipping table creation for {table_names} for {sa_engine.dialect.name}")
                return
            LOGGER.info(
                f"SQLA:{SQLA_VERSION} - Creating `{sa_engine.dialect.name}` table for {table_names} if it does not exist"  # noqa: E501 # FIXME CoP
            )
            dialect = GXSqlDialect(sa_engine.dialect.name)
            created_tables: list[dict[Literal["table_name", "schema"], str | None]] = []
    
            with gx_engine.get_connection() as conn:
                quoted_upper_col: str = quote_str(QUOTED_UPPER_COL, dialect=dialect)
                quoted_lower_col: str = quote_str(QUOTED_LOWER_COL, dialect=dialect)
                quoted_w_dots: str = quote_str(QUOTED_W_DOTS, dialect=dialect)
                quoted_mixed_case: str = quote_str(QUOTED_MIXED_CASE, dialect=dialect)
                transaction = conn.begin()
                if schema:
                    conn.execute(TextClause(f"CREATE SCHEMA IF NOT EXISTS {schema}"))
                for name in table_names:
                    qualified_table_name = f"{schema}.{name}" if schema else name
                    # TODO: use dialect specific quotes
                    create_tables: str = (
                        f"CREATE TABLE IF NOT EXISTS {qualified_table_name}"
                        " (id INTEGER, name VARCHAR(255),"
                        f" {quoted_upper_col} VARCHAR(255), {quoted_lower_col} VARCHAR(255),"
                        f" {UNQUOTED_UPPER_COL} VARCHAR(255), {UNQUOTED_LOWER_COL} VARCHAR(255),"
                        f" {quoted_mixed_case} VARCHAR(255), {quoted_w_dots} VARCHAR(255))"
                    )
                    conn.execute(TextClause(create_tables))
                    if data:
                        insert_data = (
                            f"INSERT INTO {qualified_table_name}"
                            f" (id, name, {quoted_upper_col}, {quoted_lower_col},"
                            f" {UNQUOTED_UPPER_COL}, {UNQUOTED_LOWER_COL},"
                            f" {quoted_mixed_case}, {quoted_w_dots})"
                            " VALUES (:id, :name, :quoted_upper_col, :quoted_lower_col,"
                            " :unquoted_upper_col, :unquoted_lower_col,"
                            " :quoted_mixed_case, :quoted_w_dots)"
                        )
                        conn.execute(TextClause(insert_data), data)
    
                    created_tables.append(dict(table_name=name, schema=schema))
                transaction.commit()
            all_created_tables[sa_engine.dialect.name] = created_tables
            engines[sa_engine.dialect.name] = sa_engine
    
        yield _table_factory
    
        # teardown
        print(f"dropping tables\n{pf(all_created_tables)}")
        for dialect, tables in all_created_tables.items():
            if dialect in DO_NOT_DROP_TABLES:
                print(f"skipping drop for {dialect}")
                continue
            engine = engines[dialect]
            with engine.connect() as conn:
                transaction = conn.begin()
                schema: str | None = None
                for table in tables:
                    name = table["table_name"]
                    schema = table["schema"]
                    qualified_table_name = f"{schema}.{name}" if schema else name
>                   conn.execute(TextClause(f"DROP TABLE IF EXISTS {qualified_table_name}"))

.../fluent/integration/test_sql_datasources.py:440: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:1416: in execute
    return meth(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/sql/elements.py:515: in _execute_on_connection
    return connection._execute_clauseelement(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:1638: in _execute_clauseelement
    ret = self._execute_context(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:1843: in _execute_context
    return self._exec_single_context(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:1983: in _exec_single_context
    self._handle_dbapi_exception(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:2352: in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/base.py:1964: in _exec_single_context
    self.dialect.do_execute(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../sqlalchemy/engine/default.py:942: in do_execute
    cursor.execute(statement, parameters)
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/client.py:801: in execute
    execute_response = self.thrift_backend.execute_command(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:919: in execute_command
    return self._handle_execute_response(resp, cursor)
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:1011: in _handle_execute_response
    final_operation_state = self._wait_until_command_done(
.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:846: in _wait_until_command_done
    self._check_command_not_in_error_or_closed_state(op_handle, poll_resp)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <databricks.sql.thrift_backend.ThriftBackend object at 0x7f7af59196f0>
op_handle = TOperationHandle(operationId=THandleIdentifier(guid=b'\x01\xef\xdf7%\x9c\x12k\xb9\xf2)fI\x1fJg', secret=b'3\x8dR\x9d\x82rF\xeb\x84\x82\xcbA\x94f\x83\x9d', executionVersion=None), operationType=0, hasResultSet=True, modifiedRowCount=None)
get_operations_resp = TGetOperationStatusResp(status=TStatus(statusCode=0, infoMessages=None, sqlState=None, errorCode=None, errorMessage=No...errorDetailsJson=None, responseValidation=None, idempotencyType=1, statementTimeout=172800, statementTimeoutLevel=None)

    def _check_command_not_in_error_or_closed_state(
        self, op_handle, get_operations_resp
    ):
        if get_operations_resp.operationState == ttypes.TOperationState.ERROR_STATE:
            if get_operations_resp.displayMessage:
>               raise ServerOperationError(
                    get_operations_resp.displayMessage,
                    {
                        "operation-id": op_handle
                        and self.guid_to_hex_id(op_handle.operationId.guid),
                        "diagnostic-info": get_operations_resp.diagnosticInfo,
                    },
                )
E               sqlalchemy.exc.DatabaseError: (databricks.sql.exc.ServerOperationError) [INTERNAL_ERROR] Query could not be scheduled: HTTP Response code: 503. Please try again later. SQLSTATE: XX000
E               [SQL: DROP TABLE IF EXISTS py310_i413d0242e87b4ad282b9371a84dfbb65.Test_Table]
E               (Background on this error at: https://sqlalche..../e/20/4xp6)

.../hostedtoolcache/Python/3.10.16............................................................/x64/lib/python3.10.../databricks/sql/thrift_backend.py:574: DatabaseError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@deborahniesz deborahniesz force-pushed the DOC-911_Left_nav_does_not_highlight_active_page branch from 40490e4 to 4d4e554 Compare January 30, 2025 15:49
@deborahniesz deborahniesz force-pushed the DOC-911_Left_nav_does_not_highlight_active_page branch from 4d4e554 to 515b2e3 Compare January 30, 2025 18:15
Copy link
Member

@josectobar josectobar left a comment

Choose a reason for hiding this comment

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

This change makes sense for desktop view but it makes the menu less functional on mobile. Can we test keeping the menu as if for small screens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants