profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/KiraPC/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Kira KiraPC Enel Group Rome, IT https://kirapc.github.io/portfolio/ There's almost always a better way.

KiraPC/fastapi-router-controller 18

A FastAPI utility to allow Controller Class usage

KiraPC/fastapi-mvc-boilerplate 7

A sample FastAPI project implemented using the MVC Pattern.

gds-data-school/katacoda-scenarios 0

Katacoda Scenarios

KiraPC/amazon-product-availability 0

A nodejs script that will check the amazon product availabilty

KiraPC/beanie 0

Asynchronous Python ODM for MongoDB

KiraPC/community-telegram-bot 0

Funny and Stupid Telegram bot of OpenSource Support Group

KiraPC/fast-json-stringify 0

2x faster than JSON.stringify()

KiraPC/fastapi 0

FastAPI framework, high performance, easy to learn, fast to code, ready for production

KiraPC/fastapi-openapi-generator 0

A Command Line Interface to save openapi file from a FastAPI application

startedrust-lang/rustlings

started time in 2 days

push eventKiraPC/portfolio

KiraPC

commit sha 7082b829468347b38f81a4aac83c75643263cfd2

added new exp

view details

push time in 5 days

push eventKiraPC/portfolio

KiraPC

commit sha 0d4e413672f65daa14fe74a57052277090c7c851

added new exp

view details

push time in 5 days

issue commentkrbcontext/python-krbcontext

gssapi error

@tkdchen Same error with your same gssapi version.

I'm on MacOS Big Sur 11.5

cnfree0355

comment created time in 2 months

push eventKiraPC/beanie

KiraPC

commit sha bcba6426b6383cb47b7dbc1db899a3dd31ba0dfc

create index by alias if exists

view details

KiraPC

commit sha 1bb883f81a03c22a27bdb5945592c208c5ad195a

check alias existance not required

view details

Roman

commit sha fbe5d1a5556565cdd94722168e57c6ae81f318da

version: 1.2.5

view details

Roman

commit sha d839a808f8681210057e444da669fb4af9c262f3

Merge pull request #97 from KiraPC/issue-96 create the index by field alias if exists

view details

Roman

commit sha ffb83a468f11e2ec4a4e886804bbdb5151852091

examples update

view details

push time in 2 months

Pull request review commentroman-right/beanie

create index by alias if exists

 async def collection_factory(     # Indexed field wrapped with Indexed()     found_indexes = [         IndexModel(-            [(fname, fvalue.type_._indexed[0])], **fvalue.type_._indexed[1]+            [+                (+                    fvalue.alias if hasattr(fvalue, "alias") else fname,

Done!

KiraPC

comment created time in 2 months

PullRequestReviewEvent

push eventKiraPC/beanie

KiraPC

commit sha 1bb883f81a03c22a27bdb5945592c208c5ad195a

check alias existance not required

view details

push time in 2 months

Pull request review commentroman-right/beanie

create index by alias if exists

 async def test_flagged_index_creation():     }  +async def test_flagged_index_creation_with_alias():

Never commit without tests :D

(except when I added the typing, never tested type before in python :))

KiraPC

comment created time in 2 months

PullRequestReviewEvent

Pull request review commentroman-right/beanie

create index by alias if exists

 async def collection_factory(     # Indexed field wrapped with Indexed()     found_indexes = [         IndexModel(-            [(fname, fvalue.type_._indexed[0])], **fvalue.type_._indexed[1]+            [+                (+                    fvalue.alias if hasattr(fvalue, "alias") else fname,

Can we assume that fvalue is always a Field instance?

KiraPC

comment created time in 2 months

PullRequestReviewEvent

pull request commentroman-right/beanie

create index by alias if exists

Fix for https://github.com/roman-right/beanie/issues/96

KiraPC

comment created time in 2 months

PR opened roman-right/beanie

create index by alias if exists
+34 -1

0 comment

4 changed files

pr created time in 2 months

create barnchKiraPC/beanie

branch : issue-96

created branch time in 2 months

push eventKiraPC/beanie

eqperes

commit sha 8d2c0ac4a806816b8499d417fa10d25bed045356

Correct typo in the README.md

view details

Roman

commit sha f155fce34ee393edb1ccc1dcf4bbd94b01da6991

Merge pull request #93 from eqperes/main Correct typo in the README.md

view details

Roman

commit sha 6e4339899809adbde57c48b8c840297be6a78449

fix: preset aggregations (#94)

view details

push time in 2 months

issue openedroman-right/beanie

Indexed Field does not support alias

When creating a new collection with an attribute used as custom index and the value of this attribute is an instance of FieldType, I expect that the index on mongo is created used the Field attribute, instead, it is created with the field name and this could broke the application logic.

import asyncio
from beanie import Document, init_beanie
from motor.motor_asyncio import AsyncIOMotorClient
from pydantic import Field
from beanie.odm.fields import Indexed


class Program(Document):
    class Collection:
        name = "test-program"

    program_id: Indexed(str, unique=True) = Field(..., alias="programId")


async def test():
    new_db_client = AsyncIOMotorClient("mongodb://localhost:27017")

    new_db = new_db_client["testdb"]
    await init_beanie(database=new_db, document_models=[Program])

    program1 = Program(program_id='test-program-1')
    await program1.insert() # OK

    program2 = Program(program_id='test-program-2')
    await program2.insert() # Error: E11000 duplicate key error collection: testdb.test-program index: program_id_1 dup key: { program_id: null }, full error: {'index': 0, 'code': 11000, 'keyPattern': {'program_id': 1}, 'keyValue': {'program_id': None}, 'errmsg': 'E11000 duplicate key error collection: testdb.test-program index: program_id_1 dup key: { program_id: null }'}


asyncio.run(test())

The expected result is that both document are stored on the collection.

Instead, removing the alias attribute from Field, it work well, because the document is store with the attribute program_id.

created time in 2 months

push eventKiraPC/beanie

Roman

commit sha cad3b840a41bb0ef201d89a8e32b6a829bf0556d

bool type in search criteria (#86)

view details

Roman

commit sha b48fb9b3539eb53efbbbe716e3b72fa59b7ea99c

Fix/issue 87 pyright (#88) pyright issues fixed with some ignores

view details

Roman

commit sha 87a63429edf7cca7a8bd2ff019b62bf77e4f28f2

fix: job name

view details

KiraPC

commit sha c0d7e09d7b482d7f5749049ed028d9ae70d726b8

Merge branch 'main' into py-interface

view details

push time in 2 months

push eventKiraPC/beanie

Roman

commit sha cad3b840a41bb0ef201d89a8e32b6a829bf0556d

bool type in search criteria (#86)

view details

Roman

commit sha b48fb9b3539eb53efbbbe716e3b72fa59b7ea99c

Fix/issue 87 pyright (#88) pyright issues fixed with some ignores

view details

Roman

commit sha 87a63429edf7cca7a8bd2ff019b62bf77e4f28f2

fix: job name

view details

push time in 2 months

pull request commentroman-right/beanie

Py interface

Hi @roman-right

Yes, I saw the alternative on how to put the stub files, so I got the decision to put them in the same folder of the source code for this reasons:

  • Got inspiration by a famous Python library that is "numpy", it use the same approach for its interfaces
  • For a personal experience. When using a new library, I use to explore the source code directly on the IDE, go to the source of the functionality I'm using by the VSCode feature "go to definition". This feature bring you to the pyi file, if exists, and if the source code is in the same directory, it is easier to have a look on it.

Anyway, lets discuss together what do you prefer.

I'll align with main ASAP.

KiraPC

comment created time in 2 months

PR opened roman-right/beanie

Py interface

I added some pyi files for the modules that has more documentation.

+688 -279

0 comment

10 changed files

pr created time in 2 months

create barnchKiraPC/beanie

branch : py-interface

created branch time in 2 months

issue closedspulec/moto

How to raise an Exception

This is not a bug but a support request.

Is there a way to raise a specific exception with moto?

I mean, I have a client, and when it is called by some arguments, I would like to raise an Exception.

Thanks you

closed time in 2 months

KiraPC

issue commentspulec/moto

How to raise an Exception

Hi @bblommers thanks you for the quickly response.

No specific exception, I was just thinking about some possibile scenarios in my application tests.

Anyway, I got the point, I'll try to figured out in another way.

KiraPC

comment created time in 2 months

issue openedspulec/moto

How to raise an Exception

This is not a bug but a support request.

Is there a way to raise a specific exception with moto?

I mean, I have a client, and when it is called by some arguments, I would like to raise an Exception.

Thanks you

created time in 2 months

push eventKiraPC/beanie

KiraPC

commit sha f9bfb30068d77a9c27f1f6106eb5733f50083541

supporting type annotation for queries results

view details

Roman

commit sha eda1340ca6ac5357c2fb19ecca10e4cfb61d2683

Type annotations for query results supporting type annotation for queries results

view details

push time in 2 months

created tagKiraPC/fastapi-router-controller

tag0.4.1

A FastAPI utility to allow Controller Class usage

created time in 2 months

release KiraPC/fastapi-router-controller

0.4.1

released time in 2 months

push eventKiraPC/fastapi-router-controller

Kira

commit sha b3c2d93a9e1fb242586f2a9b9259aad734c9da98

Merge pull request #21 from KiraPC/master Dev alignment

view details

Kira

commit sha e105701ebce2e03a0e00ac182c10941daf1b7e22

Merge pull request #22 from KiraPC/dev Merge pull request #21 from KiraPC/master

view details

push time in 2 months