diff --git a/.all-contributorsrc b/.all-contributorsrc index 0b95361b80..bd1e01d6c0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -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, diff --git a/README.md b/README.md index 4134dc7b3e..7878335db8 100644 --- a/README.md +++ b/README.md @@ -438,6 +438,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Marcel Johannesmann
Marcel Johannesmann

📖 Matthew
Matthew

📖 Mattwmaster58
Mattwmaster58

🐛 💻 ⚠️ + Manuel Sanchez Pinar
Manuel Sanchez Pinar

📖 diff --git a/docs/usage/dto/0-basic-use.rst b/docs/usage/dto/0-basic-use.rst index 415efa60ae..490970beda 100644 --- a/docs/usage/dto/0-basic-use.rst +++ b/docs/usage/dto/0-basic-use.rst @@ -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``. diff --git a/docs/usage/dto/2-creating-custom-dto-classes.rst b/docs/usage/dto/2-creating-custom-dto-classes.rst index 202ad4fdec..ff90ee4223 100644 --- a/docs/usage/dto/2-creating-custom-dto-classes.rst +++ b/docs/usage/dto/2-creating-custom-dto-classes.rst @@ -22,5 +22,5 @@ the model fields. ``detect_nested_field`` ----------------------- -This method receives a :class:`FieldDefinition` instance it it should return a boolean +This method receives a :class:`FieldDefinition` instance and it should return a boolean indicating whether the field is a nested model field. diff --git a/docs/usage/dto/index.rst b/docs/usage/dto/index.rst index b54580646b..46bac7ed21 100644 --- a/docs/usage/dto/index.rst +++ b/docs/usage/dto/index.rst @@ -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: diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index cb32498df3..ba0bd61044 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -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: diff --git a/tests/docker_service_fixtures.py b/tests/docker_service_fixtures.py index bc996776d9..dd11dcc013 100644 --- a/tests/docker_service_fixtures.py +++ b/tests/docker_service_fixtures.py @@ -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 @@ -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() @@ -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 @@ -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 diff --git a/tests/unit/test_contrib/test_sqlalchemy/test_repository/test_repository.py b/tests/unit/test_contrib/test_sqlalchemy/test_repository/test_repository.py index dfeae97e08..9de345c40e 100644 --- a/tests/unit/test_contrib/test_sqlalchemy/test_repository/test_repository.py +++ b/tests/unit/test_contrib/test_sqlalchemy/test_repository/test_repository.py @@ -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 @@ -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", }, @@ -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", },