cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Use OF API from package enerbitdso 0.1.8 PYPI

Colombia
New Contributor II

Hello! I have code to use an API supplied in the energitdso package (This is the repository https://pypi.org/project/enerbitdso/). I changed the code adapting it to AZURE DATABRICKS in python, but although there is a connection with the API, it does not return results. This is my code: 

# Instalar enerbitdso (asegรบrese de que esto se ejecuta sin errores)
%pip install enerbitdso

# Importar librerรญas
import os
from dotenv import load_dotenv

# Ruta relativa al archivo .env
env_file_path = "./.env"

# Cargar las variables de entorno desde el archivo .env
load_dotenv(env_file_path)

# Acceder a las variables de entorno
api_base_url = os.getenv("ENERBIT_API_BASE_URL")
api_username = os.getenv("ENERBIT_API_USERNAME")
api_password = os.getenv("ENERBIT_API_PASSWORD")

# Mostrar las variables de entorno (para verificar la carga correcta)
print(f"API Base URL: {api_base_url}")
print(f"API Username: {api_username}")
print(f"API Password: {api_password}")  # **Nota:** Evite compartir credenciales reales en el cรณdigo

# Ejecutar la consulta de uso de enerbitdso
# Asegรบrese de tener los permisos necesarios para los cรณdigos FRT especificados
!enerbitdso usages fetch Frt08942 Frt46756 Frt47799
1 REPLY 1

Colombia
New Contributor II

The owner of the package updated it to use the time out as a parameter of up to 20 seconds and updated a dependent package in DataBricks, with the above the problem was solved

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group