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

graphene-sqlalchemy > abc-sqlalchemy/next #2

Open
wants to merge 66 commits into
base: next/abc-master
Choose a base branch
from

Conversation

maquino1985
Copy link
Owner

No description provided.

jnak and others added 30 commits June 7, 2019 12:12
…#214)

This implements the overriding mechanism discussed in #209 .

Changes include:

- Add ORMField class
- The main overridable parameters are: type, description, deprecation_reason and required
- We can name fields differently using prop_name. This was preferred over name to avoid confusion / collision with graphene.Field parameters.
- Add tests for all types of SQLAlchemy properties: columns, relationships, column properties, hybrid properties and and composite properties.
- Cleanups and re-organize some tests.
* Fix deprecation warnings
* Release `2.2.1`
* Add unrelated test to increase test coverage and unblock PR
Check against six.string_types instead of str for python 2 compatibility
This optimization batches what used to be multiple SQL statements into a single SQL statement. For now, you'll have to enable the optimization via the `SQLAlchemyObjectType.Meta.connection_field_factory` (see `test_batching.py`).
Add `pytest-benchmark` so we can easily track performance changes over time


Others:
* disable tests for Python 3.4 
* upgrade coveralls
Currently to get the default connection of a `SQLAlchemyObjectType`, you have to go through `_meta`. For example, `PetType._meta.connection`. This adds a public way to get it.
It contains a fix for a thread-safety issue in Dataloader.
Add parameters to toggle batching on or off. This can be configured at 2 levels:
- we can configure all the fields of a type at once via SQLAlchemyObjectType.meta.batching
- or we can specify it for a specific field via ORMfield.batching. This trumps SQLAlchemyObjectType.meta.batching.
Use this to test batching
Use sqlalchemy.types.LargeBinary instead of Binary
* Add support for Non-Null SQLAlchemyConnectionField
* Remove implicit ORDER BY clause to fix tests with SQLAlchemy 1.3.16
* move from travis to github actions

* add flake8 to tox

* add flake8 as env in tox

* add flake8 to setup

* remove sqlalchemy 1.1 in tests

* fix flake8 exclude

* move coveralls to github action

* fix coverall github action config

* move coveralls to tox

* move coveralls dep to test list

* add coverage command

* move coveralls back into github action

* modify coverage output
Co-authored-by: Jonathan Ehwald <[email protected]>
Co-authored-by: Zbigniew Siciarz <[email protected]>
Co-authored-by: Cole Lin <[email protected]>
For <span style="color:red">~~instaling~~</span><span style="color:green">installing</span> <span style="color:red">~~g~~</span><span style="color:green">Graphene</span>, just run this command in your shell<span style="color:green">.</span>
* Add newlines to make pre-commit happy

* Fix import from graphql_relay

The module name was deprecated, but all imports
should be made from the top level anyway.
These changes modify graphene-sqlalchemy so as not to suppress errors coming
from SQLAlchemy when attempting to map classes. Previously this made the
debugging experience difficult since issues with SQLAlchemy models
would produce an unclear error message from graphene-sqlalchemy. With
these changes, the SQLAlchemy error is propagated to the end-user,
allowing them to correct the real issue quickly.

Fixes #121
…e annotations. (#340)

Adds support for automatic type conversion for @hybrid_property's using converters similar to @convert_sqlalchemy_type.register(). Currently, all basic types and (nested) Lists are supported.
This feature replaces the old default string conversion. String conversion is still used as a fallback in case no compatible converter was found to ensure backward compatibility.

Thank you @conao3 & @flipbit03!
…ference. (#343)

Automatic @hybrid_property type conversion now supports Optionals.
This PR drops tests for Python 3.6 and updates the build scripts.
flipbit03 and others added 30 commits September 13, 2022 09:22
…mentation housed inside graphene, if possible (graphene >=3.1.1) (#362)
* Support GQL interfaces for polymorphic SQLA models using SQLALchemyInterface and SQLAlchemyBase. fixes #313 


Co-authored-by: Erik Wrede <[email protected]>
Co-authored-by: Erik Wrede <[email protected]>
* feat(async): add support for async sessions
This PR brings experimental support for async sessions in SQLAlchemyConnectionFields. Batching is not yet supported and will be subject to a later PR.
Co-authored-by: Jendrik <[email protected]>
Co-authored-by: Erik Wrede <[email protected]>
Install instructions in the README.md fails with an error: „Could not find a version that satisfies the requirement graphene-sqlalchemy>=3“

This is because v3 is in beta. Therefore, installing with '--pre' fixes the problem.
* refactor!: use the same conversion system for hybrids and columns
fix: insert missing create_type in union conversion

Breaking Change: convert_sqlalchemy_type now uses a matcher function
Breaking Change: convert_sqlalchemy type's column and registry arguments must now be keyword arguments
Breaking Change: convert_sqlalchemy_type support for subtypes is dropped, each column type must be explicitly registered
Breaking Change: The hybrid property default column type is no longer a string. If no matching column type was found, an exception will be raised.

Signed-off-by: Erik Wrede <[email protected]>

* fix: catch import error in older sqlalchemy versions

Signed-off-by: Erik Wrede <[email protected]>

* fix: union test for 3.10

Signed-off-by: Erik Wrede <[email protected]>

* fix: use type and value for all columns

Signed-off-by: Erik Wrede <[email protected]>

* refactor: rename value_equals to column_type_eq

Signed-off-by: Erik Wrede <[email protected]>

* tests: add tests for string fallback removal of hybrid property
chore: change the exception types

Signed-off-by: Erik Wrede <[email protected]>

* chore: refactor converter for object types and scalars

Signed-off-by: Erik Wrede <[email protected]>

* chore: remove string fallback from forward references

Signed-off-by: Erik Wrede <[email protected]>

* chore: adjust comment

Signed-off-by: Erik Wrede <[email protected]>

* fix: fix regression on id types from last commit

Signed-off-by: Erik Wrede <[email protected]>

* refactor: made registry calls in converters lazy

Signed-off-by: Erik Wrede <[email protected]>

* fix: DeclarativeMeta import path adjusted for sqa<1.4

Signed-off-by: Erik Wrede <[email protected]>

Signed-off-by: Erik Wrede <[email protected]>
to-many relationships are now non-null by default. (List[MyType] -> List[MyType!]!)
The behavior can be adjusted back to legacy using `converter.set_non_null_many_relationships(False)`
or using an `ORMField` manually setting the type for more granular Adjustments
* fix: Make ORMField(type_) work in case there is no registered converter

* revert/feat!: Type Converters support subtypes again.
this feature adjusts the conversion system to use the MRO of a supplied class

* tests: add test cases for mro & orm field fixes

* tests: use custom type instead of BIGINT due to version incompatibilities
This PR updates the dataloader and unit tests to be compatible with sqlalchemy 2.0
* Add database session to the example

Coming from https://docs.graphene-python.org/projects/sqlalchemy/en/latest/tutorial/ as a python noob I failed to run their example but could fix this example by adding the database session.

* Update README.md

---------

Co-authored-by: Erik Wrede <[email protected]>
* association_proxy support

* better support for assoc proxy lists (rather than one-to-one)

* scope down

* add support for sqlalchemy 1.1

* fix pytest due to master merge

* fix: throw error when association proxy could not be converted

* fix: adjust association proxy to new relationship handling

---------
Co-authored-by: Erik Wrede <[email protected]>
* Recreate loader if old loader is on incorrect loop

* Lint

---------

Co-authored-by: Cadu <[email protected]>
Co-authored-by: Paul Schweizer <[email protected]>
Co-authored-by: Erik Wrede <[email protected]>
* Add support for python 3.12

Fixes #416

* Remove python 3.7

* Drop python 3.8, add 3.13

* housekeeping: ci 3.9-3.13

---------

Co-authored-by: Erik Wrede <[email protected]>
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

Successfully merging this pull request may close these issues.