gdZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z d d l m Z d d l m Zd d l m Z d dl mZd dl mZerd dlmZd dlmZd dlmZe deZeefZ Gddej4ZeZGddej4ZGddej<ZGddej4Z Gddej4Z!Gdd eZ"Gd!d"eZ#Gd#d$ej<Z$Gd%d&ej<Z%Gd'd(ej<Z&d-d)Z'e jPd*d.d+Z)y,)/zSQLAlchemy ORM exceptions.) annotations)Any)Optional)Tuple)Type) TYPE_CHECKING)TypeVar)_mapper_property_as_plain_name)exc)util)MultipleResultsFound) NoResultFound)LoaderStrategy)MapperProperty) InstanceState_T)boundceZdZdZy)StaleDataErroraaAn operation encountered database state that is unaccounted for. Conditions which cause this to happen include: * A flush may have attempted to update or delete rows and an unexpected number of rows were matched during the UPDATE or DELETE statement. Note that when version_id_col is used, rows in UPDATE or DELETE statements are also matched against the current known version identifier. * A mapped object with version_id_col was refreshed, and the version number coming back from the database does not match that of the object itself. * A object is detached from its parent object, however the object was previously attached to a different parent identity which was garbage collected, and a decision cannot be made if the new parent was really the most recent "parent". N__name__ __module__ __qualname____doc__C/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/orm/exc.pyrr$srrceZdZdZy) FlushErrorz0A invalid condition was detected during flush().Nrrrrr!r!@s:rr!ceZdZdZy) UnmappedErrorz?Base for exceptions that involve expected mappings not present.Nrrrrr#r#DsIrr#ceZdZdZy)ObjectDereferencedErrorzPAn operation cannot complete due to an object being garbage collected. Nrrrrr%r%Hsrr%ceZdZdZdZy)DetachedInstanceErrorzSAn attempt to access unloaded attributes on a mapped instance that is detached.bhk3N)rrrrcoderrrr'r'Os) Drr'cLeZdZdZej ddddZddZy) UnmappedInstanceErrorz;An mapping operation was requested for an unknown instance.sqlalchemy.orm.baseNchtjj}|s8 |jt |t t |}d|d|d}tj||y#t $r<dt t |d}t|tr|dt |zz }Y[wxYw)NzClass z| is mapped, but this instance lacks instrumentation. This occurs when the instance is created before sqlalchemy.orm.mapper(z ) was called.Class '' is not mappedz;; was a class (%s) supplied where an instance was required?) r preloadedorm_base class_mappertype_safe_cls_nameUnmappedClassError isinstancer#__init__)selfobjmsgbasenames rr7zUnmappedInstanceError.__init__Ys~~&& !!$s),%d3i0 &*41 tS)& tCy 9:/Jc4($&4S&9:C s7A,,AB10B1c<|jd|jdffSNr __class__argsr8s r __reduce__z UnmappedInstanceError.__reduce__p~~diil333rN)r9objectr: Optional[str]returnrrrrrrpreload_moduler7rCrrrr+r+Vs*ET./*0*,4rr+c"eZdZdZdddZddZy)r5z8An mapping operation was requested for an unknown class.NcJ|s t|}tj||yrE)_default_unmappedr#r7)r8clsr:s rr7zUnmappedClassError.__init__ws#C(CtS)rc<|jd|jdffSr>r?rBs rrCzUnmappedClassError.__reduce__|rDrrE)rOzType[_T]r:rGrH)rrrrr7rCrrrr5r5tsB* 4rr5cLeZdZdZej ddddZddZy) ObjectDeletedErroraA refresh operation failed to retrieve the database row corresponding to an object's known primary key identity. A refresh operation proceeds when an expired attribute is accessed on an object, or when :meth:`_query.Query.get` is used to retrieve an object which is, upon retrieval, detected as expired. A SELECT is emitted for the target row based on primary key; if no row is returned, this exception is raised. The true meaning of this exception is simply that no row exists for the primary key identifier associated with a persistent object. The row may have been deleted, or in some cases the primary key updated to a new value, outside of the ORM's management of the target object. r,Nctjj}|sd|j|z}tj j ||y)NzDInstance '%s' has been deleted, or its row is otherwise not present.)rr0r1 state_strsa_excInvalidRequestErrorr7)r8stater:r;s rr7zObjectDeletedError.__init__sH~~&&026..2GH  ""++D#6rc<|jd|jdffSr>r?rBs rrCzObjectDeletedError.__reduce__rDrrE)rWzInstanceState[Any]r:rGrHrJrrrrRrRs.&T./ 70 74rrRceZdZdZy)UnmappedColumnErrorz5Mapping operation was requested on an unknown column.NrrrrrZrZs?rrZc,eZdZdZ ddZy)LoaderStrategyExceptionz2A loader strategy for an attribute does not exist.c |'tjj|d|d|y|Jtjj|dtj|d|dt |dt |d y)NzCan't find strategy z for z Can't apply "z" strategy to property "z", which is a "z7"; this loader strategy is intended to be used with a "z".)rUrVr7rclsname_as_plain_namer )r8applied_to_property_typerequesting_property applies_toactual_strategy_type strategy_keys rr7z LoaderStrategyException.__init__s{ '  & & / /!46  ) ))  & & / / ../CD'23KL2:> rN) r_ Type[Any]r`zMapperProperty[Any]raz#Optional[Type[MapperProperty[Any]]]rbzOptional[Type[LoaderStrategy]]rczTuple[Any, ...])rrrrr7rrrr\r\s:<"+18  =  & rr\c dj|j|jf}|S#t$rt |dd}| t |}Y|SwxYw)N.r)joinrrAttributeErrorgetattrrepr)rOcls_names rr4r4s]!88S^^S\\:; O !3 D1  CyH O !s'+#AAr,ctjj} |j|j}t|}|sd|dSy#t t ftz$ri}Y.wxYw)Nr.r/) rr0r1manager_of_classmappersr5 TypeErrorNO_STATEr4)rOr;rnr<s rrNrNsw >> " "D'',44 # D o..     sA A&%A&N)rOrdrIstr)rOrdrIrG)*r __future__rtypingrrrrrr rr r rUrr interfacesrrrWrrrhKeyErrorrpSQLAlchemyErrorrConcurrentModificationErrorr!rVr#r%r'r+r5rRrZr\r4rKrNrrrrys0!" 0&**$ T H %LV++2-;'';JF..Jf44F224M4< 4 4!433!4H@&44@f88B*+,r