From 25db94d13880bc66ecb7c36528d02238607853a1 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 12 Nov 2024 12:10:51 +1100 Subject: [PATCH] Fix code line length --- lib/sqlalchemy/dialects/oracle/base.py | 13 +++++++------ lib/sqlalchemy/dialects/oracle/types.py | 12 +++++++----- lib/sqlalchemy/engine/events.py | 3 ++- lib/sqlalchemy/ext/compiler.py | 3 ++- lib/sqlalchemy/orm/context.py | 6 +++--- lib/sqlalchemy/sql/compiler.py | 3 ++- lib/sqlalchemy/sql/operators.py | 6 +++--- lib/sqlalchemy/sql/schema.py | 4 ++-- lib/sqlalchemy/sql/selectable.py | 6 +++--- 9 files changed, 31 insertions(+), 25 deletions(-) diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index 0d51b3e034..dccaeaff73 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -965,10 +965,10 @@ class OracleCompiler(compiler.SQLCompiler): "Computed columns don't work with Oracle Database UPDATE " "statements that use RETURNING; the value of the column " "*before* the UPDATE takes place is returned. It is " - "advised to not use RETURNING with an Oracle Database computed " - "column. Consider setting implicit_returning to False on " - "the Table object in order to avoid implicit RETURNING " - "clauses from being generated for this Table." + "advised to not use RETURNING with an Oracle Database " + "computed "column. Consider setting implicit_returning " + "to False on "the Table object in order to avoid implicit " + "RETURNING clauses from being generated for this Table." ) if column.type._has_column_expression: col_expr = column.type.column_expression(column) @@ -1373,8 +1373,9 @@ class OracleDDLCompiler(compiler.DDLCompiler): ) if generated.persisted is True: raise exc.CompileError( - "Oracle Database computed columns do not support 'stored' persistence; " - "set the 'persisted' flag to None or False for Oracle Database support." + "Oracle Database computed columns do not support 'stored' " + "persistence; set the 'persisted' flag to None or False for " + "Oracle Database support." ) elif generated.persisted is False: text += " VIRTUAL" diff --git a/lib/sqlalchemy/dialects/oracle/types.py b/lib/sqlalchemy/dialects/oracle/types.py index c75fbd9f7a..2f84415ea8 100644 --- a/lib/sqlalchemy/dialects/oracle/types.py +++ b/lib/sqlalchemy/dialects/oracle/types.py @@ -92,10 +92,11 @@ class FLOAT(sqltypes.FLOAT): r""" Construct a FLOAT - :param binary_precision: Oracle Database binary precision value to be rendered - in DDL. This may be approximated to the number of decimal characters - using the formula "decimal precision = 0.30103 * binary precision". - The default value used by Oracle Database for FLOAT / DOUBLE PRECISION is 126. + :param binary_precision: Oracle Database binary precision value to be + rendered in DDL. This may be approximated to the number of decimal + characters using the formula "decimal precision = 0.30103 * binary + precision". The default value used by Oracle Database for FLOAT / + DOUBLE PRECISION is 126. :param asdecimal: See :paramref:`_sqltypes.Float.asdecimal` @@ -261,7 +262,8 @@ class TIMESTAMP(sqltypes.TIMESTAMP): use Oracle Database's ``TIMESTAMP WITH TIME ZONE`` datatype. :param local_timezone: boolean. Indicates that the TIMESTAMP type - should use Oracle Database's ``TIMESTAMP WITH LOCAL TIME ZONE`` datatype. + should use Oracle Database's ``TIMESTAMP WITH LOCAL TIME ZONE`` + datatype. """ diff --git a/lib/sqlalchemy/engine/events.py b/lib/sqlalchemy/engine/events.py index 0323700c40..2273dd2c41 100644 --- a/lib/sqlalchemy/engine/events.py +++ b/lib/sqlalchemy/engine/events.py @@ -930,7 +930,8 @@ class DialectEvents(event.Events[Dialect]): The setinputsizes hook overall is only used for dialects which include the flag ``use_setinputsizes=True``. Dialects which use this - include python-oracledb, cx_Oracle, pg8000, asyncpg, and pyodbc dialects. + include python-oracledb, cx_Oracle, pg8000, asyncpg, and pyodbc + dialects. .. note:: diff --git a/lib/sqlalchemy/ext/compiler.py b/lib/sqlalchemy/ext/compiler.py index 2408b97184..9d4be255c0 100644 --- a/lib/sqlalchemy/ext/compiler.py +++ b/lib/sqlalchemy/ext/compiler.py @@ -226,7 +226,8 @@ A synopsis is as follows: @compiles(coalesce, 'oracle') def compile(element, compiler, **kw): if len(element.clauses) > 2: - raise TypeError("coalesce only supports two arguments on Oracle Database") + raise TypeError("coalesce only supports two arguments on " + "Oracle Database") return "nvl(%s)" % compiler.process(element.clauses, **kw) * :class:`.ExecutableDDLElement` - The root of all DDL expressions, diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py index 6ac237f118..f8d3711fc4 100644 --- a/lib/sqlalchemy/orm/context.py +++ b/lib/sqlalchemy/orm/context.py @@ -1580,9 +1580,9 @@ class ORMSelectCompileState(ORMCompileState, SelectState): statement._label_style = self.label_style # Oracle Database however does not allow FOR UPDATE on the subquery, - # and the Oracle Database dialects ignore it, plus for PostgreSQL, MySQL - # we expect that all elements of the row are locked, so also put it - # on the outside (except in the case of PG when OF is used) + # and the Oracle Database dialects ignore it, plus for PostgreSQL, + # MySQL we expect that all elements of the row are locked, so also put + # it on the outside (except in the case of PG when OF is used) if ( self._for_update_arg is not None and self._for_update_arg.of is None diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index d759a76c52..3135a059c5 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2348,7 +2348,8 @@ class SQLCompiler(Compiled): """Called when a SELECT statement has no froms, and no FROM clause is to be appended. - Gives Oracle Database a chance to tack on a ``FROM DUAL`` to the string output. + Gives Oracle Database a chance to tack on a ``FROM DUAL`` to the string + output. """ return "" diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index c6af601856..c1c3841456 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -1605,9 +1605,9 @@ class ColumnOperators(Operators): the operator as "REGEXP" or "NOT REGEXP". This is compatible with SQLite and MySQL, for example. - Regular expression support is currently implemented for Oracle Database, - PostgreSQL, MySQL and MariaDB. Partial support is available for - SQLite. Support among third-party dialects may vary. + Regular expression support is currently implemented for Oracle + Database, PostgreSQL, MySQL and MariaDB. Partial support is available + for SQLite. Support among third-party dialects may vary. :param pattern: The regular expression pattern string or column clause. diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index f068453b1f..19d8f9f96e 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -3870,8 +3870,8 @@ class Sequence(HasSchemaAttr, IdentityOptions, DefaultGenerator): understood by Oracle Database and PostgreSQL. :param order: optional boolean value; if ``True``, renders the - ORDER keyword, understood by Oracle Database, indicating the sequence is - definitively ordered. May be necessary to provide deterministic + ORDER keyword, understood by Oracle Database, indicating the sequence + is definitively ordered. May be necessary to provide deterministic ordering using Oracle RAC. :param data_type: The type to be returned by the sequence, for diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index ee6176d8fc..8aa4babeb9 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -530,9 +530,9 @@ class HasHints: **specific to a single table** to a statement, in a location that is **dialect-specific**. To add generic optimizer hints to the **beginning** of a statement ahead of the SELECT keyword such as - for MySQL or Oracle Database, use the :meth:`_expression.Select.prefix_with` - method. To add optimizer hints to the **end** of a statement such - as for PostgreSQL, use the + for MySQL or Oracle Database, use the + :meth:`_expression.Select.prefix_with` method. To add optimizer + hints to the **end** of a statement such as for PostgreSQL, use the :meth:`_expression.Select.with_statement_hint` method. The text of the hint is rendered in the appropriate -- 2.47.3