Skip to content

Commit

Permalink
Merge branch 'main' into v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cofin committed Aug 21, 2023
2 parents 6d77c51 + 96fec8b commit f7c6bfe
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
7 changes: 7 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,13 @@
"avatar_url": "https://avatars.githubusercontent.com/u/26337069?v=4",
"profile": "https://github.com/Mattwmaster58",
"contributions": ["bug", "code", "test"]
},
{
"login": "aorith",
"name": "Manuel Sanchez Pinar",
"avatar_url": "https://avatars.githubusercontent.com/u/5411704?v=4",
"profile": "https://es.linkedin.com/in/manusp",
"contributions": ["doc"]
}
],
"contributorsPerLine": 7,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mj0nez"><img src="https://avatars.githubusercontent.com/u/20128340?v=4?s=100" width="100px;" alt="Marcel Johannesmann"/><br /><sub><b>Marcel Johannesmann</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=mj0nez" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://zanfar.com/"><img src="https://avatars.githubusercontent.com/u/10294685?v=4?s=100" width="100px;" alt="Matthew"/><br /><sub><b>Matthew</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=therealzanfar" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Mattwmaster58"><img src="https://avatars.githubusercontent.com/u/26337069?v=4?s=100" width="100px;" alt="Mattwmaster58"/><br /><sub><b>Mattwmaster58</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/issues?q=author%3AMattwmaster58" title="Bug reports">🐛</a> <a href="https://github.com/litestar-org/litestar/commits?author=Mattwmaster58" title="Code">💻</a> <a href="https://github.com/litestar-org/litestar/commits?author=Mattwmaster58" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://es.linkedin.com/in/manusp"><img src="https://avatars.githubusercontent.com/u/5411704?v=4?s=100" width="100px;" alt="Manuel Sanchez Pinar"/><br /><sub><b>Manuel Sanchez Pinar</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=aorith" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/dto/0-basic-use.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Basic Use
=========

Here we demonstrates how to declare DTO types to your route handlers. For demonstration purposes, we assume that we
Here we demonstrate how to declare DTO types to your route handlers. For demonstration purposes, we assume that we
are working with a data model ``User``, and already have two DTO types created in our application, ``UserDTO``, and
``UserReturnDTO``.

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/dto/2-creating-custom-dto-classes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ the model fields.
``detect_nested_field``
-----------------------

This method receives a :class:`FieldDefinition<litestar.typing.FieldDefinition>` instance it it should return a boolean
This method receives a :class:`FieldDefinition<litestar.typing.FieldDefinition>` instance and it should return a boolean
indicating whether the field is a nested model field.
2 changes: 1 addition & 1 deletion docs/usage/dto/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Data Transfer Object (DTO)
==========================

In Litestar, a Data Transfer Object (DTO) is class that is used to control the flow of data from the client into a
In Litestar, a Data Transfer Object (DTO) is a class that is used to control the flow of data from the client into a
useful form for the developer to use in their handler, and then back again.

The following diagram demonstrates how the DTO is used within the context of an individual request in Litestar:
Expand Down
2 changes: 1 addition & 1 deletion tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
MYSQL_ROOT_HOST: "%"
LANG: C.UTF-8
oracle:
image: gvenzl/oracle-xe:latest-faststart
image: gvenzl/oracle-xe:18-slim-faststart
ports:
- "1512:1521" # use a non-standard port here
environment:
Expand Down
10 changes: 5 additions & 5 deletions tests/docker_service_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def mysql_responsive(host: str) -> bool:
async with conn.cursor() as cursor:
await cursor.execute("select 1 as is_available")
resp = await cursor.fetchone()
return resp[0] == 1
return resp[0] == 1 # type: ignore
except asyncmy.errors.OperationalError:
return False

Expand All @@ -162,7 +162,7 @@ async def postgres_responsive(host: str) -> bool:
return False

try:
return (await conn.fetchrow("SELECT 1"))[0] == 1
return (await conn.fetchrow("SELECT 1"))[0] == 1 # type: ignore
finally:
await conn.close()

Expand All @@ -184,8 +184,8 @@ def oracle_responsive(host: str) -> bool:
with conn.cursor() as cursor:
cursor.execute("SELECT 1 FROM dual")
resp = cursor.fetchone()
return resp[0] == 1
except (OperationalError, DatabaseError):
return resp[0] == 1 # type: ignore
except (OperationalError, DatabaseError, Exception):
return False


Expand All @@ -211,7 +211,7 @@ def spanner_responsive(host: str) -> bool:
pass
with database.snapshot() as snapshot:
resp = next(iter(snapshot.execute_sql("SELECT 1")))
return resp[0] == 1
return resp[0] == 1 # type: ignore
except Exception:
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import annotations

import asyncio
import json
import os
from datetime import datetime, timezone
from typing import Any, Dict, Generator, Iterator, List, Literal, Type, Union, cast
Expand Down Expand Up @@ -115,7 +114,7 @@ def fx_raw_rules_uuid() -> RawRecordData:
{
"id": "f34545b9-663c-4fce-915d-dd1ae9cea42a",
"name": "Initial loading rule.",
"config": json.dumps({"url": "https://litestar.dev", "setting_123": 1}),
"config": {"url": "https://litestar.dev", "setting_123": 1},
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-02-01T00:00:00",
},
Expand Down Expand Up @@ -183,7 +182,7 @@ def fx_raw_rules_bigint() -> RawRecordData:
{
"id": 2025,
"name": "Initial loading rule.",
"config": json.dumps({"url": "https://litestar.dev", "setting_123": 1}),
"config": {"url": "https://litestar.dev", "setting_123": 1},
"created_at": "2023-01-01T00:00:00",
"updated_at": "2023-02-01T00:00:00",
},
Expand Down

0 comments on commit f7c6bfe

Please sign in to comment.