Skip to content

Python: Add modeling of peewee#6161

Merged
yoff merged 9 commits into
github:mainfrom
RasmusWL:peewee-modeling
Aug 17, 2021
Merged

Python: Add modeling of peewee#6161
yoff merged 9 commits into
github:mainfrom
RasmusWL:peewee-modeling

Conversation

@RasmusWL

Copy link
Copy Markdown
Member

No description provided.

RasmusWL added 6 commits June 25, 2021 16:08
So global namespace doesn't contain `Connection` whenever `PEP249.qll`
is imported
For Peewee modeling I want to be able to define new cursor instances
just like I can do for connections.
Notice that since this will be part of the same PR as 5cfc433, it is OK
to do this change without keeping `PEP249::cursor` for backwards
compatibility.

@yoff yoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only small things. Overall quite nice :-)

Comment thread python/ql/src/semmle/python/frameworks/internal/PEP249Impl.qll Outdated
Comment thread python/ql/src/semmle/python/frameworks/internal/PEP249Impl.qll Outdated
Comment thread python/ql/src/semmle/python/frameworks/internal/PEP249Impl.qll Outdated
Comment on lines +55 to +65
result =
API::moduleImport("playhouse")
.getMember("cockroachdb")
.getMember("CockroachDatabase")
.getASubclass*()
or
result =
API::moduleImport("playhouse")
.getMember("cockroachdb")
.getMember("PooledCockroachDatabase")
.getASubclass*()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is quite long. It could become about half the size with rewrites like the following:

Suggested change
result =
API::moduleImport("playhouse")
.getMember("cockroachdb")
.getMember("CockroachDatabase")
.getASubclass*()
or
result =
API::moduleImport("playhouse")
.getMember("cockroachdb")
.getMember("PooledCockroachDatabase")
.getASubclass*()
result =
API::moduleImport("playhouse")
.getMember("cockroachdb")
.getMember(["CockroachDatabase", "PooledCockroachDatabase"])
.getASubclass*()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As highlighted by the comment above, these are semi auto generated, so I don't think it's worth it to go through this trouble.

Co-authored-by: yoff <lerchedahl@gmail.com>
@RasmusWL RasmusWL requested a review from yoff August 17, 2021 13:17

@yoff yoff left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yoff yoff merged commit 50a4345 into github:main Aug 17, 2021
@RasmusWL RasmusWL deleted the peewee-modeling branch August 18, 2021 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants