Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Classe « GenerativeSelect »

Méthode sqlalchemy.GenerativeSelect.set_label_style

Signature de la méthode set_label_style

def set_label_style(self, style: 'SelectLabelStyle') -> 'Self' 

Description

help(GenerativeSelect.set_label_style)

Return a new selectable with the specified label style.

There are three "label styles" available,
:attr:`_sql.SelectLabelStyle.LABEL_STYLE_DISAMBIGUATE_ONLY`,
:attr:`_sql.SelectLabelStyle.LABEL_STYLE_TABLENAME_PLUS_COL`, and
:attr:`_sql.SelectLabelStyle.LABEL_STYLE_NONE`.   The default style is
:attr:`_sql.SelectLabelStyle.LABEL_STYLE_DISAMBIGUATE_ONLY`.

In modern SQLAlchemy, there is not generally a need to change the
labeling style, as per-expression labels are more effectively used by
making use of the :meth:`_sql.ColumnElement.label` method. In past
versions, :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL` was used to
disambiguate same-named columns from different tables, aliases, or
subqueries; the newer :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY` now
applies labels only to names that conflict with an existing name so
that the impact of this labeling is minimal.

The rationale for disambiguation is mostly so that all column
expressions are available from a given :attr:`_sql.FromClause.c`
collection when a subquery is created.

.. versionadded:: 1.4 - the
    :meth:`_sql.GenerativeSelect.set_label_style` method replaces the
    previous combination of ``.apply_labels()``, ``.with_labels()`` and
    ``use_labels=True`` methods and/or parameters.

.. seealso::

    :data:`_sql.LABEL_STYLE_DISAMBIGUATE_ONLY`

    :data:`_sql.LABEL_STYLE_TABLENAME_PLUS_COL`

    :data:`_sql.LABEL_STYLE_NONE`

    :data:`_sql.LABEL_STYLE_DEFAULT`



Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé