From d0cbdd8cc21c9c879cbe3cf7a25eb7624388d5ad Mon Sep 17 00:00:00 2001 From: aplatkouski <5857672+aplatkouski@users.noreply.github.com> Date: Tue, 16 Jun 2020 15:56:48 +0300 Subject: [PATCH] Fix typos in 'Column and Data Types' Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com> --- doc/build/core/custom_types.rst | 4 ++-- doc/build/core/type_api.rst | 1 - lib/sqlalchemy/sql/sqltypes.py | 20 +++++++++----------- lib/sqlalchemy/sql/type_api.py | 4 ++-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/doc/build/core/custom_types.rst b/doc/build/core/custom_types.rst index 740d1593f3..c9970872da 100644 --- a/doc/build/core/custom_types.rst +++ b/doc/build/core/custom_types.rst @@ -473,7 +473,7 @@ Redefining and Creating New Operators ------------------------------------- SQLAlchemy Core defines a fixed set of expression operators available to all column expressions. -Some of these operations have the effect of overloading Python's built in operators; +Some of these operations have the effect of overloading Python's built-in operators; examples of such operators include :meth:`.ColumnOperators.__eq__` (``table.c.somecolumn == 'foo'``), :meth:`.ColumnOperators.__invert__` (``~table.c.flag``), @@ -484,7 +484,7 @@ explicit methods on column expressions, such as The Core expression constructs in all cases consult the type of the expression in order to determine the behavior of existing operators, as well as to locate additional operators that aren't part of -the built in set. The :class:`.TypeEngine` base class defines a root "comparison" implementation +the built-in set. The :class:`.TypeEngine` base class defines a root "comparison" implementation :class:`.TypeEngine.Comparator`, and many specific types provide their own sub-implementations of this class. User-defined :class:`.TypeEngine.Comparator` implementations can be built directly into a simple subclass of a particular type in order to override or define new operations. Below, diff --git a/doc/build/core/type_api.rst b/doc/build/core/type_api.rst index 115cbd202f..0dd1b49205 100644 --- a/doc/build/core/type_api.rst +++ b/doc/build/core/type_api.rst @@ -20,5 +20,4 @@ Base Type API .. autoclass:: Variant - :members: with_variant, __init__ diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index a143a2241c..ff0b22544a 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -594,7 +594,7 @@ class Numeric(_LookupExpressionAdapter, TypeEngine): type that is explicitly known to be a decimal type (e.g. ``DECIMAL``, ``NUMERIC``, others) and not a floating point type (e.g. ``FLOAT``, ``REAL``, others). - If the database column on the server is in fact a floating-point type + If the database column on the server is in fact a floating-point type, such as ``FLOAT`` or ``REAL``, use the :class:`.Float` type or a subclass, otherwise numeric coercion between ``float``/``Decimal`` may or may not function as expected. @@ -1161,7 +1161,7 @@ class SchemaType(SchemaEventTarget): return self.metadata and self.metadata.bind or None def create(self, bind=None, checkfirst=False): - """Issue CREATE ddl for this type, if applicable.""" + """Issue CREATE DDL for this type, if applicable.""" if bind is None: bind = _bind_or_error(self) @@ -1170,7 +1170,7 @@ class SchemaType(SchemaEventTarget): t.create(bind=bind, checkfirst=checkfirst) def drop(self, bind=None, checkfirst=False): - """Issue DROP ddl for this type, if applicable.""" + """Issue DROP DDL for this type, if applicable.""" if bind is None: bind = _bind_or_error(self) @@ -1417,7 +1417,7 @@ class Enum(Emulated, String, SchemaType): default, the database value of the enumeration is used as the sorting function. - .. versionadded:: 1.3.8 + .. versionadded:: 1.3.8 @@ -1808,11 +1808,9 @@ class Boolean(Emulated, TypeEngine, SchemaType): appropriate naming convention; see :ref:`constraint_naming_conventions` for background. - .. versionchanged:: 1.4 - this flag now defaults to False, meaning - no CHECK constraint is generated for a non-native enumerated - type. - - + .. versionchanged:: 1.4 - this flag now defaults to False, meaning + no CHECK constraint is generated for a non-native enumerated + type. :param name: if a CHECK constraint is generated, specify the name of the constraint. @@ -2273,7 +2271,7 @@ class JSON(Indexable, TypeEngine): self.none_as_null = none_as_null class JSONElementType(TypeEngine): - """common function for index / path elements in a JSON expression.""" + """Common function for index / path elements in a JSON expression.""" _integer = Integer() _string = String() @@ -2599,7 +2597,7 @@ class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): __visit_name__ = "ARRAY" zero_indexes = False - """if True, Python zero-based indexes should be interpreted as one-based + """If True, Python zero-based indexes should be interpreted as one-based on the SQL expression side.""" class Comparator(Indexable.Comparator, Concatenable.Comparator): diff --git a/lib/sqlalchemy/sql/type_api.py b/lib/sqlalchemy/sql/type_api.py index dbd5fd2001..83c7960ac8 100644 --- a/lib/sqlalchemy/sql/type_api.py +++ b/lib/sqlalchemy/sql/type_api.py @@ -389,7 +389,7 @@ class TypeEngine(Traversible): """Return the corresponding type object from the underlying DB-API, if any. - This can be useful for calling ``setinputsizes()``, for example. + This can be useful for calling ``setinputsizes()``, for example. """ return None @@ -914,7 +914,7 @@ class TypeDecorator(SchemaEventTarget, TypeEngine): coerce_to_is_types = (util.NoneType,) """Specify those Python types which should be coerced at the expression level to "IS " when compared using ``==`` (and same for - ``IS NOT`` in conjunction with ``!=``. + ``IS NOT`` in conjunction with ``!=``). For most SQLAlchemy types, this includes ``NoneType``, as well as ``bool``. -- 2.47.3