MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / go

Method go

lib/sqlalchemy/sql/selectable.py:4947–4980  ·  view source on GitHub ↗
(
            c: Union[ColumnElement[Any], AbstractTextClause],
            col_name: Optional[str] = None,
        )

Source from the content-addressed store, hash-verified

4945 names = set()
4946
4947 def go(
4948 c: Union[ColumnElement[Any], AbstractTextClause],
4949 col_name: Optional[str] = None,
4950 ) -> Optional[str]:
4951 if is_text_clause(c):
4952 return None
4953 elif TYPE_CHECKING:
4954 assert is_column_element(c)
4955
4956 if not dedupe:
4957 name = c._proxy_key
4958 if name is None:
4959 name = "_no_label"
4960 return name
4961
4962 name = c._tq_key_label if table_qualified else c._proxy_key
4963
4964 if name is None:
4965 name = "_no_label"
4966 if name in names:
4967 return c._anon_label(name) % pa
4968 else:
4969 names.add(name)
4970 return name
4971
4972 elif name in names:
4973 return (
4974 c._anon_tq_key_label % pa
4975 if table_qualified
4976 else c._anon_key_label % pa
4977 )
4978 else:
4979 names.add(name)
4980 return name
4981
4982 return go
4983

Callers

nothing calls this directly

Calls 4

is_text_clauseFunction · 0.85
is_column_elementFunction · 0.85
_anon_labelMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected