User bio
404 bio not found
Member since Oct 9, 2023
Posts:
Replies:
Certifications & Credly badges:
Augustin has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Augustin has no followers yet.
Following:
Augustin has not followed anybody yet.
Avec l'approche Python, je rencontre l'erreur suivante :
ERREUR <Ens>ErrCanNotAcquireJobRootLock: Impossible d'obtenir un verrouillage pour l'enregistrement de la globale
Ci-dessous le code implémenté :
import pandas as pd
from sqlalchemy import create_engine, types
class FileOperationEmbedded(BusinessOperation):
tablename = None
engine = None
def on_init(self):
if not hasattr(self, "dsnIris"):
self.dnsIris = 'iris+emb:///'
if not hasattr(self, "schema"):
self.schema = 'Toto'
self.engine = create_engine(self.dnsIris)
return None
def on_message(self, request:DFrameRequest):
df = pd.DataFrame(request.dframe.col)
for row in request.dframe.col:
df = pd.DataFrame.from_dict(row, orient='index').T.reset_index(drop=True)
try:
df.to_sql(name=self.tablename, con=self.engine, if_exists='append', index=False, schema=self.schema,
dtype={'id': types.INTEGER, 'col_type': types.VARCHAR(50), 'col_center': types.VARCHAR(50),
'col_name': types.VARCHAR(50), 'col_issue_name': types.VARCHAR(50),
'col_model': types.VARCHAR(50), 'col_treatment': types.VARCHAR(50),
'source': types.VARCHAR(50), 'filename': types.VARCHAR(100), 'created_at': types.TIMESTAMP})
except Exception as e:
self.log_info(f"Une erreur s'est produite : {e}")
return None
Avez-vous une idée d'où pourrait provenir l'erreur et quel la marche suivre pour résoudre le problème ?