Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 2019 16:42
    fantix commented #428
  • Jan 31 2019 14:11
    wwwjfy labeled #432
  • Jan 31 2019 14:11
    wwwjfy commented #432
  • Jan 31 2019 14:10

    wwwjfy on pyup-update-pytest-4.1.0-to-4.2.0

    (compare)

  • Jan 31 2019 14:10

    wwwjfy on master

    Update pytest from 4.1.0 to 4.2… (compare)

  • Jan 31 2019 14:10
    wwwjfy closed #431
  • Jan 31 2019 13:05
    diegoyosiura opened #432
  • Jan 31 2019 07:08
    aliyarly starred fantix/gino
  • Jan 31 2019 03:48
    coveralls commented #431
  • Jan 31 2019 03:41
    pyup-bot opened #431
  • Jan 31 2019 03:41

    fantix on pyup-update-pytest-4.1.0-to-4.2.0

    Update pytest from 4.1.0 to 4.2… (compare)

  • Jan 31 2019 03:41

    fantix on pyup-update-pytest-4.1.0-to-4.2.0

    (compare)

  • Jan 31 2019 01:55
  • Jan 30 2019 13:55

    wwwjfy on pyup-update-quart-0.6.10-to-0.7.0

    (compare)

  • Jan 30 2019 13:06

    wwwjfy on pyup-update-flake8-3.5.0-to-3.7.1

    (compare)

  • Jan 30 2019 13:06

    wwwjfy on master

    Update flake8 from 3.5.0 to 3.7… use latest flake8 in tests, ref… Merge pull request #430 from fa… (compare)

  • Jan 30 2019 13:06
    wwwjfy closed #430
  • Jan 30 2019 13:03
    coveralls commented #430
  • Jan 30 2019 12:58
    wwwjfy synchronize #430
  • Jan 30 2019 12:58

    wwwjfy on pyup-update-flake8-3.5.0-to-3.7.1

    use latest flake8 in tests, ref… (compare)

Fantix King
@fantix
sure
Cobalt
@Chaostheorie
Thanks ^^
Fantix King
@fantix
np, done
Cobalt
@Chaostheorie
Could you activate it for https://github.com/python-gino/gino-quart it seems admin permissions are required
Fantix King
@fantix
Only security updates
Only lockfile updates (ignore updates that require Pipfile changes)
Only top-level dependencies (and security patches for subdependencies)
preferences pls?
Cobalt
@Chaostheorie
top-level dependencies would be nice
Would help me with keeping track of newer wuart etc versions
Thanks a lot
Fantix King
@fantix
OK! np - and live updates? Or daily/weekly/monthly?
Cobalt
@Chaostheorie
monthly.
Fantix King
@fantix
all set :+1:
Cobalt
@Chaostheorie
Thanks
Fantix King
@fantix
thank you!
Erus Lawliet
@eruslawliet_twitter
hi there, how can I do a .join() with Gino to obtain a model instead of a RowProxy?
Fantix King
@fantix
Erus Lawliet
@eruslawliet_twitter
thanks, I was a little confused but I could make it work :)
Fantix King
@fantix
:+1:
Erus Lawliet
@eruslawliet_twitter
hello! is there a way in Gino to do a cascade delete?
Erus Lawliet
@eruslawliet_twitter
hello! im trying to do a subquery but i get sqlalchemy.exc.ArgumentError: SQL expression object expected, got object of type <class 'gino.crud.QueryModel'> instead
i'm basically trying to traduce this sql statement into gino: SELECT DISTINCT participant.loop_id FROM participant WHERE (participant.loop_id not in (SELECT DISTINCT participant.loop_id FROM participant WHERE participant.account_id = ?));
2 replies
Daniel Mannarino
@dmannarino

Hi folks! I'm having trouble with a Gino WHERE...IN query, perhaps you can point out what I'm doing wrong. The code used to be

query = ORMAsset.query if asset_type is not None: query = query.where(ORMAsset.asset_type == asset_type)
which works fine (asset_type is a string). But I want to make asset_type possibly a list, so I changed this to
query = ORMAsset.query if asset_type is not None: if type(asset_type) == List: query = query.where(ORMAsset.asset_type.in_(asset_type)) else: query = query.where(ORMAsset.asset_type == asset_type)
Gino doesn't like this, throwing asyncpg.exceptions.DataError: invalid input for query argument $3: [<AssetType.raster_tile_set: 'Raster til... (expected str, got list)
Any idea why this is failing? Apologies for the formatting, I'm trying to make it better.

2 replies
Daniel Mannarino
@dmannarino
Oh, I also tried ORMAsset.asset_type in asset_type to the same result.
Cobalt
@Chaostheorie

i'm basically trying to traduce this sql statement into gino: SELECT DISTINCT participant.loop_id FROM participant WHERE (participant.loop_id not in (SELECT DISTINCT participant.loop_id FROM participant WHERE participant.account_id = ?));

You can do this or define the column with the foreign key with Column(..., ondelete="CASCADE") when defining your schema. Otherwise you may have to just use query and delete

Cobalt
@Chaostheorie
e.g. query.where(table.foreign_id == toreign_table.id)…
Pavel Savchenko
@asfaltboy
Hi, does anyone know what the equivalent of SQLAlchemy's (ORM) options(db.defer('location')) in gino (ref docs)?
Pavel Savchenko
@asfaltboy

Figured I could exclude a field using select method of the model, i.e:

cols = [c.name for c in MyModel.__table__.c if c.name != 'large_field']
MyModel.select(*cols).where(MyModel.field != None).gino.all()

Would adding it to the docs be a good idea? Is the a better way to deal with deferring fields?

7 replies
Andrey
@Nordhaimer_twitter
Hi, there. How can I make such sql with gino:
select groups, coalesce(json_agg(child_groups) filter (where child_groups.parent_id is not null), '[]') FROM groups LEFT OUTER JOIN groups AS child_groups ON groups.id = child_groups.parent_id group by groups.id;
6 replies
const-shi
@const-shi

hi! i want do something like that

await select([User]).select_from(User.outerjoin(Group)).limit(1)
await User.update.values(name="123").where(User.id ==1)

so no .gino.all() and gino.status()
i can do that after that hack:

from sqlalchemy.sql import Select, Update, Delete, Insert
from sqlalchemy.sql.base import Executable
def executable_await(self):
    if isinstance(self, (Update, Delete)):
        return self.gino.status().__await__()
    elif isinstance(self, (Select, Insert)):
        return self.gino.all().__await__()
Executable.__await__ = executable_await
UpdateRequest.__await__ = lambda self: self.apply().__await__()

is that ok?

19 replies
Cody Flynn
@codyflynnNC
Hello! Should the returned object from Gino() have autocompletion support for the base sqlachemy column types? In pycharm the only completion I get is for instance methods when I type hint like this db: Gino = Gino()
Fantix King
@fantix
@codyflynnNC hey~ I worked on the autocompletion a bit before, it's not easy but also not impossible. I'll try to introduce better typing into 1.4, and hopefully backport to 1.2. Before that, you may use the types from sqlalchemy directly
Thiago
@braindata_company_gitlab
Im using poetry install , but my own dependency is not installing
anyone knows why ?
Thiago
@braindata_company_gitlab
AttributeError: 'Config' object has no attribute 'DB_DSN'
anyone knows this error ?
Sem
@Sadbot

Hello!
How can I update some rows and return the updated models? In SQL I can write: update ... returning *
But in gino I write:

    stmt = (
        update(Model)
            .where(Model.status == "new")
            .values(status="pending")
            .returning()
    )

    return await stmt.gino.load(Model).status()

and it's returning:

('UPDATE 1', [])

One row was updated, but no models returned. Anyone knows what I do wrong?

2 replies
MasterBiryer
@MasterBiryer
Hello all,
Please bare with a gino noob, like me. I have a stupid problem: I cannot bind gino instance to a specific engine.
The problem comes from the fact I am using a framework I do not know very well and:
1/ I do not create the Gino() instance myself, although I can get the said instance
2/ But then, when I want to use it, I get a Gino engine is not initialized error
3/ But then, when I try to use set_bind() it fails because it is async
4/ But then, when I try to wait for its completion using async.run(db.set_bind(DB_URL))) it fails elsewhere with a 'cannot perform operation: another operation is in progress'
SO:
I am sure there is a 'standard way' to achieve that but I have no clue nor any pointer.
3 replies
Any comment welcome.
:D
Thank you.
MasterBiryer
@MasterBiryer
(And now Gitter will not let me init my own post :-( ...)
I wanted to say I am using asyncio, not asyncpg, if this is of any importance.