Skip to content

Commit a31adf5

Browse files
authored
Merge branch 'main' into docs-fastapi-lifespan-v2
2 parents 1181a33 + 880150b commit a31adf5

File tree

7 files changed

+55
-6
lines changed

7 files changed

+55
-6
lines changed

.github/workflows/issue-manager.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ jobs:
4141
"message": "As this PR has been waiting for the original user for a while but seems to be inactive, it's now going to be closed. But if there's anyone interested, feel free to create a new PR.",
4242
"reminder": {
4343
"before": "P3D",
44-
"message": "Heads-up: this will be closed in 3 days unless theres new activity."
44+
"message": "Heads-up: this will be closed in 3 days unless there's new activity."
4545
}
4646
},
4747
"invalid": {
4848
"delay": 0,
4949
"message": "This was marked as invalid and will be closed now. If this is an error, please provide additional details."
50+
},
51+
"maybe-ai": {
52+
"delay": 0,
53+
"message": "This was marked as potentially AI generated and will be closed now. If this is an error, please provide additional details, make sure to read the docs about contributing and AI."
5054
}
5155
}

docs/contributing.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,39 @@ This helps to make sure that:
158158
* The documentation is up-to-date.
159159
* The documentation examples can be run as is.
160160
* Most of the features are covered by the documentation, ensured by test coverage.
161+
162+
## Automated Code and AI
163+
164+
You are encouraged to use all the tools you want to do your work and contribute as efficiently as possible, this includes AI (LLM) tools, etc. Nevertheless, contributions should have meaningful human intervention, judgement, context, etc.
165+
166+
If the **human effort** put in a PR, e.g. writing LLM prompts, is **less** than the **effort we would need to put** to **review it**, please **don't** submit the PR.
167+
168+
Think of it this way: we can already write LLM prompts or run automated tools ourselves, and that would be faster than reviewing external PRs.
169+
170+
### Closing Automated and AI PRs
171+
172+
If we see PRs that seem AI generated or automated in similar ways, we'll flag them and close them.
173+
174+
The same applies to comments and descriptions, please don't copy paste the content generated by an LLM.
175+
176+
### Human Effort Denial of Service
177+
178+
Using automated tools and AI to submit PRs or comments that we have to carefully review and handle would be the equivalent of a <a href="https://en.wikipedia.org/wiki/Denial-of-service_attack" class="external-link" target="_blank">Denial-of-service attack</a> on our human effort.
179+
180+
It would be very little effort from the person submitting the PR (an LLM prompt) that generates a large amount of effort on our side (carefully reviewing code).
181+
182+
Please don't do that.
183+
184+
We'll need to block accounts that spam us with repeated automated PRs or comments.
185+
186+
### Use Tools Wisely
187+
188+
As Uncle Ben said:
189+
190+
<blockquote>
191+
With great <strike>power</strike> <strong>tools</strong> comes great responsibility.
192+
</blockquote>
193+
194+
Avoid inadvertently doing harm.
195+
196+
You have amazing tools at hand, use them wisely to help effectively.

docs/js/custom.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ function setupTermynal() {
8181
}
8282
}
8383
saveBuffer();
84+
const inputCommands = useLines.filter(line => line.type === "input").map(line => line.value).join("\n");
85+
node.textContent = inputCommands;
8486
const div = document.createElement("div");
85-
node.replaceWith(div);
87+
node.style.display = "none";
88+
node.after(div);
8689
const termynal = new Termynal(div, {
8790
lineData: useLines,
8891
noInit: true,

docs/release-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
## Latest Changes
44

5+
### Refactors
6+
7+
* ♻️ Import `Literal` from the `typing` module directly. PR [#1699](https://github.com/fastapi/sqlmodel/pull/1699) by [@svlandeg](https://github.com/svlandeg).
8+
59
### Docs
610

11+
* 📝 Add contribution instructions about LLM generated code and comments and automated tools for PRs. PR [#1712](https://github.com/fastapi/sqlmodel/pull/1712) by [@alejsdev](https://github.com/alejsdev).
12+
* 🐛 Fix copy button in `custom.js`. PR [#1711](https://github.com/fastapi/sqlmodel/pull/1711) by [@alejsdev](https://github.com/alejsdev).
713
* 📝 Remove duplicated word in `read-relationships.md`. PR [#1705](https://github.com/fastapi/sqlmodel/pull/1705) by [@stefmolin](https://github.com/stefmolin).
814

915
### Internal

sqlmodel/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Any,
1515
Callable,
1616
ClassVar,
17+
Literal,
1718
Optional,
1819
TypeVar,
1920
Union,
@@ -48,7 +49,7 @@
4849
from sqlalchemy.orm.instrumentation import is_instrumented
4950
from sqlalchemy.sql.schema import MetaData
5051
from sqlalchemy.sql.sqltypes import LargeBinary, Time, Uuid
51-
from typing_extensions import Literal, TypeAlias, deprecated, get_origin
52+
from typing_extensions import TypeAlias, deprecated, get_origin
5253

5354
from ._compat import ( # type: ignore[attr-defined]
5455
PYDANTIC_MINOR_VERSION,

sqlmodel/sql/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from collections.abc import Iterable, Mapping, Sequence
22
from typing import (
33
Any,
4+
Literal,
45
Optional,
56
TypeVar,
67
Union,
@@ -34,7 +35,6 @@
3435
UnaryExpression,
3536
)
3637
from sqlalchemy.sql.type_api import TypeEngine
37-
from typing_extensions import Literal
3838

3939
from ._expression_select_cls import Select as Select
4040
from ._expression_select_cls import SelectOfScalar as SelectOfScalar

tests/test_pydantic/test_field.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from decimal import Decimal
2-
from typing import Optional, Union
2+
from typing import Literal, Optional, Union
33

44
import pytest
55
from pydantic import ValidationError
66
from sqlmodel import Field, SQLModel
7-
from typing_extensions import Literal
87

98

109
def test_decimal():

0 commit comments

Comments
 (0)