cybertron-spark 0.1.7__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/PKG-INFO +1 -1
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark/heartbeat.py +14 -17
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark.egg-info/PKG-INFO +1 -1
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/setup.py +1 -1
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/LICENCE +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/README.md +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark/__init__.py +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark/selenium.py +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark/zenpy.py +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark.egg-info/SOURCES.txt +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark.egg-info/dependency_links.txt +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark.egg-info/requires.txt +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark.egg-info/top_level.txt +0 -0
- {cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/setup.cfg +0 -0
|
@@ -206,34 +206,31 @@ class Heartbeat():
|
|
|
206
206
|
|
|
207
207
|
return self._patch(endpoint, payload)
|
|
208
208
|
|
|
209
|
-
def salvar_bugiganga(self,
|
|
209
|
+
def salvar_bugiganga(self, lista_dados):
|
|
210
|
+
"""
|
|
211
|
+
Recebe uma LISTA DE DICIONÁRIOS já tratada e envia para a API.
|
|
212
|
+
Não faz tratamento de dados.
|
|
213
|
+
"""
|
|
210
214
|
endpoint = '/transformers/bots-bugigangasave/'
|
|
211
215
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
for col in colunas_data:
|
|
216
|
-
if col in df_save.columns:
|
|
217
|
-
df_save[col] = pd.to_datetime(df_save[col], errors='coerce').dt.strftime('%Y-%m-%dT%H:%M:%S')
|
|
216
|
+
if not lista_dados or not isinstance(lista_dados, list):
|
|
217
|
+
print("⚠️ salvar_bugiganga: Lista vazia ou formato inválido recebido.")
|
|
218
|
+
return 0
|
|
218
219
|
|
|
219
|
-
df_save = df_save.replace({np.nan: None})
|
|
220
|
-
df_save = df_save.where(pd.notnull(df_save), None)
|
|
221
|
-
|
|
222
|
-
payload_total = df_save.to_dict(orient='records')
|
|
223
|
-
|
|
224
220
|
batch_size = 500
|
|
225
221
|
total_enviado = 0
|
|
226
222
|
|
|
227
|
-
print(f"📦 Iniciando envio de {len(
|
|
223
|
+
print(f"📦 Biblioteca: Iniciando envio de {len(lista_dados)} registros...")
|
|
228
224
|
|
|
229
|
-
for i in range(0, len(
|
|
230
|
-
lote =
|
|
225
|
+
for i in range(0, len(lista_dados), batch_size):
|
|
226
|
+
lote = lista_dados[i:i + batch_size]
|
|
231
227
|
|
|
232
228
|
response = self._post(endpoint, lote)
|
|
229
|
+
|
|
233
230
|
if response and response.status_code in [200, 201]:
|
|
234
231
|
total_enviado += len(lote)
|
|
235
232
|
else:
|
|
236
|
-
print(f"⚠️ Falha no lote {i}
|
|
233
|
+
print(f"⚠️ Falha no lote {i} - {i+batch_size}")
|
|
237
234
|
|
|
238
|
-
print(f"🏁
|
|
235
|
+
print(f"🏁 Envio finalizado. Total aceito: {total_enviado}")
|
|
239
236
|
return total_enviado
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cybertron_spark-0.1.7 → cybertron_spark-0.1.9}/cybertron_spark.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|