Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few issues with the FastAPI Quickstart #8498

Open
arashmahdian opened this issue Mar 24, 2025 · 0 comments
Open

A few issues with the FastAPI Quickstart #8498

arashmahdian opened this issue Mar 24, 2025 · 0 comments

Comments

@arashmahdian
Copy link

arashmahdian commented Mar 24, 2025

https://docs.geldata.com/learn/quickstart/setup/fastapi:

  • assumes you have already installed uvx.
  • schema.update.after = "uvx gel-py" is not correct. Should be "uvx --from gel gel-py"

https://docs.geldata.com/learn/quickstart/connecting/fastapi

  • test.py requires gel, but requirements.txt does not include it.

https://docs.geldata.com/learn/quickstart/working/fastapi

  • Talks about modifying main.py even though it has never talked about it before.
  • After modifying main.py according to the instructions, running uvicorn main:app --reload leads to the following error because the f-string requires {{ ** }} instead of { ** }

Process SpawnProcess-1:
Traceback (most recent call last):
File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/home/arash/src/flashcards/venv/lib/python3.12/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
target(sockets=sockets)
File "/home/arash/src/flashcards/venv/lib/python3.12/site-packages/uvicorn/server.py", line 66, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/asyncio/runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/arash/src/flashcards/venv/lib/python3.12/site-packages/uvicorn/server.py", line 70, in serve
await self._serve(sockets)
File "/home/arash/src/flashcards/venv/lib/python3.12/site-packages/uvicorn/server.py", line 77, in _serve
config.load()
File "/home/arash/src/flashcards/venv/lib/python3.12/site-packages/uvicorn/config.py", line 435, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/arash/src/flashcards/venv/lib/python3.12/site-packages/uvicorn/importer.py", line 19, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/26yi95240650jxp5dj78xzch70i1kzlz-python3-3.12.9/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 1133, in get_code
File "", line 1063, in source_to_code
File "", line 488, in _call_with_frames_removed
File "/home/arash/src/flashcards/main.py", line 94
select updated { ** }
^^
SyntaxError: f-string: expecting a valid expression after '{'

  • client = create_client() should be replaced with client = create_async_client()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant