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

typo in f-string #20

Closed
opk12 opened this issue May 19, 2024 · 4 comments
Closed

typo in f-string #20

opk12 opened this issue May 19, 2024 · 4 comments
Labels
support General support or help request

Comments

@opk12
Copy link

opk12 commented May 19, 2024

scripts/preload.load.py:63 has a syntax error, should use " around either the f-string or the ,.

@Zaczero
Copy link
Member

Zaczero commented May 20, 2024

Hello! Please wait until the end of May with contributions, as I am still finishing up some core parts of the code and documentation 🙂. Then, I'll be able to help you. You can leave this issue open and I'll let you know when the contributor documentation is ready and the project is open.

@Zaczero
Copy link
Member

Zaczero commented Jun 9, 2024

Hello again! The project is now open for contributions and I'll now provide support. Please check out the Contributor Guide and let me know if that clarifies things! At the time of your posting this guide did not exist.

@Zaczero Zaczero added the support General support or help request label Jun 9, 2024
@starsep
Copy link
Member

starsep commented Jun 13, 2024

It's about this line: https://github.com/Zaczero/openstreetmap-ng/blob/8363ef040dc2cc3627b34581d9aa75fbdc53eac4/scripts/preload_load.py#L63

Smaller example:

from app.models.db.changeset import Changeset
from app.models.db.element import Element
from app.models.db.element_member import ElementMember
from app.models.db.user import User
tables = (User, Changeset, Element, ElementMember)
print(f'TRUNCATE {','.join(f'"{t.__tablename__}"' for t in tables)} RESTART IDENTITY CASCADE')

It works correctly in Python 3.12+.
It doesn't work in in Python 3.11 or older
Error:

    print(f'TRUNCATE {','.join(f'"{t.__tablename__}"' for t in tables)} RESTART IDENTITY CASCADE')
                       ^
SyntaxError: f-string: expecting '}'

@Zaczero
Copy link
Member

Zaczero commented Jul 1, 2024

I'll close this issue because it seems to be answered and there's no more activity 👍

@Zaczero Zaczero closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support General support or help request
Projects
None yet
Development

No branches or pull requests

3 participants