Граф коммитов

12 Коммитов

Автор SHA1 Сообщение Дата
Gergő Jedlicska fcc33f8989
style(all-project): fix all linting errors across the project with the current setup 2022-12-20 14:46:36 +01:00
Gergő Jedlicska 990cf4eb2f
style(whole-project): fixing linting and typing errors 2022-12-20 10:45:22 +01:00
Gergő Jedlicska e805b8ac6e
style(all): sort imports with isort 2022-12-09 20:48:02 +01:00
Gergő Jedlicska 0cfe5db674
reformat stuff, fix backwards compatible typing 2022-09-24 16:22:04 +02:00
Gergő Jedlicska 6fc4ab1539
update tests 2022-09-23 17:09:25 +02:00
Gergő Jedlicska 7f432e768d
Fix warnings about None type units being set on Base objects
Add proper units enum implementation

Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: Morten Engen <morten.engen@multiconsult.no>
2022-09-23 17:08:53 +02:00
Gergő Jedlicska 52ab27e60f
SQLite write batching (#188)
### SUMMARY
**sqlite transport**

This transport now batches and bulk inserts objects when writing resulting in huge performance improvements (100x).

**base object serializer**

Batching in the sqlite transport necessitated some refactoring here in order to safely call end_write when not using operations.send/receive. This has been resolved by turning traverse_base into a wrapper for _traverse_base which can take care of calling begin/end_write and resetting the writer at the top level. This is not breaking since the top level methods to call have not changed names and the original method has just been prepended with a _

Additionally, missing referenced child objects in the read transport used to raise a SpeckleException. However, using the gql client to call objects.get() will return an object with missing references by design thus throwing an error in serialization. This has been resolved by instead raising a SpeckleWarning when child objects can't be found and just returning the reference + id. ((this method of interacting with objects is discouraged so it is not surprising to me that this bug was lurking for so long - but an oopsie nonetheless!))

**ci / dev**

Updates for the ci config and the dev container to work with the recent changes in server.

NOTE: dev container seems to be pulling an older version of server -- not resolved yet

---

* quick and hacky sqlite batching

* feat(transports): batching sqlite inserts

* chore: upgrade gql3

also removed py-spy as it's not used and i was getting install errors :/

* ci: bump node version

* ci: formatting

* update CI versions

* update to new circleci redis baseimage

* update test fixture auth to non deprecated token based method

* add start and finish write method calls to base object serialize

* chore: dev container update

* fix(serialization): move end and begin write

* style: formatting

* fix(serializer): warn but don't throw if ref not found

this is _not_ an issue with the transports, but an issue with using the
graphql api to fetch objects. since you are only receiving one obj and none of
the children, the transport has no way to find them and should simply
return the reference as is. idk why anyone would really use `object.get`
so tbh i'm not surprised no one has found this bug yet lol

* fix(client): don't parse obj create response

* fix(serializer): wrap `traverse_base`

moving `begin` and `end_write` to the seriazlier due to the new
sqlite transport with batched writes necessitates a wrapper around
`traverse_base` so end/begin write can be called once at the top level.
just adding begin/end write to the original traversal method would make
tons of calls to `end_write` since the traversal is recursive

Co-authored-by: izzy lyseggen <izzy.lyseggen@gmail.com>
2022-06-20 12:00:09 +01:00
izzy lyseggen 434ada8bc1 feat: rename `speckle` to `specklepy` 2021-04-09 12:25:32 +01:00
Gergő Jedlicska 800b0018a0 style: ran formatter on codebase 2021-02-17 23:52:14 +01:00
Gergő Jedlicska e6cf22e97a feat(base.py): provide easy subclass type registration for (de)serialization
Implement automatic type register mechanism that stores all speckle Base model subclasses in a type
register for deserialization reuse in transports. This enables the Base to be useful as a base kit
object.

fix #50
2021-02-17 23:51:07 +01:00
Gergő Jedlicska 5f35da3be9 style(black config): added explicit black config to pyproject.toml 2021-02-11 21:43:28 +01:00
Gergő Jedlicska 5796ff6cdb docs(example/base_registrar.py): add example implementation for SpeckleBase class register
re #50
2021-02-11 20:34:35 +01:00