Comments (5)
more clear indents :
def is_record_type(model: t.Union[ModelBase, dict], types_module) -> bool:
# for now, records in the Main class only. could be broken late
if not hasattr(types_module, 'Main'):
return False
if isinstance(model, dict): # custom (extended) record
return types_module.Main._type == model.get('$type')
return types_module.Main._type == model._type
from atproto.
Thanks! I'll take another crack at this tomorrow if I have time.
Do you have guidelines on the formatting, listing, unit test, etc? I see you're using Black and Ruff?
from atproto.
wow. looks of course legit due to invalid isinstance() logic except how it should work
i think it should be:
def is_record_type(model: t.Union[ModelBase, dict], types_module) -> bool:
# for now records in Main. could be broken late
if hasattr(types_module, 'Main'):
if isinstance(model, RecordModelBase):
return types_module.Main._type == model._type
if isinstance(model, dict): # custom record
return types_module.Main._type == model.get('$type')
return False
we don't rly support unknown records from custom lexicons at all we case we don't know this custom lexicon... by "custom record" i mean an extended version of the base record (described by official lexicons). extended with additional fields, for example
from atproto.
Thanks! I'll take another crack at this tomorrow if I have time.
Do you have guidelines on the formatting, listing, unit test, etc? I see you're using Black and Ruff?
Not yet. All that you need is poetry run black .
and poetry run ruff . --fix
(of course after poetry install
)
from atproto.
fixed in v0.0.18
from atproto.
Related Issues (20)
- traceback.print_exc() being called outside on an except block HOT 1
- send_image is sending images 5 hours into the past.
- Misdetection of URLs / links in the "auto_huperlinks" example HOT 3
- Add snake case support for DotDict wrapper HOT 4
- sharing resource: interop-test-files HOT 4
- Invite history missing HOT 6
- Implement Access Token access for user HOT 2
- Unable to fetch thread HOT 3
- Session Handling and Token Invalidation HOT 11
- Change email HOT 1
- BadRequestError: 'Token could not be verified' HOT 2
- Add facet builder
- New Invalid Schema error as of Sept 25 HOT 6
- 1 validation error for Response HOT 1
- JwtPayload TypeError: __init__() got an unexpected keyword argument 'aud' HOT 3
- .login() got an unexpected keyword argument 'aud' HOT 2
- Intermittent error on atproto.CAR.from_bytes when using new BGS firehose: "failed to parse uvarint for header" HOT 14
- CAR Inline Example currently not working HOT 5
- BadRequestError createdAt must be an valid atproto datetime (both RFC-3339 and ISO-8601) HOT 5
- Please allow typing-extensions>=4.8.0 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atproto.