Git Product home page Git Product logo

Comments (4)

aersam avatar aersam commented on May 23, 2024

Cannot reproduce this one.... Eg, I can start the project like this:

$env:CONFIG_PATH="config_test.yml"   
$env:DATA_PATH="tests/data"
uvicorn bmsdna.lakeapi.standalone:app --host 0.0.0.0 --port 8081

from lakeapi.

dominikpeter avatar dominikpeter commented on May 23, 2024

So you always have to set the CONFIG_PATH and you are not able to control it inside the python code?

If you do that

import dataclasses
import bmsdna.lakeapi

def_cfg = bmsdna.lakeapi.get_default_config() # Get default startup config
cfg = dataclasses.replace(def_cfg, enable_sql_endpoint=True, data_path="tests/data") # Use dataclasses.replace to set the properties you want
sti = bmsdna.lakeapi.init_lakeapi(app, cfg, "config_test.yml") # Enable it. The first parameter is the FastAPI instance, the 2nd one is the basic config and the third one the config of the tables

and config.yml is not available, and no env variable is set you get the error.

from lakeapi.

aersam avatar aersam commented on May 23, 2024

that should work, too. I don't get the error:

import dataclasses
import bmsdna.lakeapi
import fastapi

app = fastapi.FastAPI()

def_cfg = bmsdna.lakeapi.get_default_config()  # Get default startup config
cfg = dataclasses.replace(
    def_cfg, enable_sql_endpoint=True, data_path="tests/data"
)  # Use dataclasses.replace to set the properties you want
sti = bmsdna.lakeapi.init_lakeapi(
    app, cfg, "config_test.yml"
) 

Started with uvicorn repo:app --host 0.0.0.0 --port 8081 where my file is called repo.py

from lakeapi.

dominikpeter avatar dominikpeter commented on May 23, 2024

I am doing something wrong :-)

from lakeapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.