Repository navigation
Python: fix static arguments on methods and class constructors - #263
Open
Tom-Kingstone wants to merge 2 commits into
Open
Tom-Kingstone wants to merge 2 commits into
Tom-Kingstone wants to merge 2 commits into
Conversation
(the unintentionally used borg design pattern)
Felix-Mallinder
requested changes
Nov 3, 2026
| @dataclass | ||
| class UsageLogEntry(): | ||
| BHoMVersion:str = BHOM_VERSION | ||
| BHoM_Guid:uuid.UUID = uuid.uuid4() |
Contributor
There was a problem hiding this comment.
I think there could be the same issue here for initialising this uuid
| BHoMVersion:str = BHOM_VERSION | ||
| BHoM_Guid:uuid.UUID = uuid.uuid4() | ||
| CallerName:str = "" | ||
| ComponentId:uuid.UUID = uuid.uuid4() |
| BHoM_Guid:uuid.UUID = uuid.uuid4() | ||
| CallerName:str = "" | ||
| ComponentId:uuid.UUID = uuid.uuid4() | ||
| CustomData:Dict = field(default_factory = {"interpreter", sys.executable}) |
Contributor
There was a problem hiding this comment.
is this supposed to be a dict ? (appreciate this is not your changes)
| Fragments:List[str] = field(default_factory = []) | ||
| Name:str = "" | ||
| ProjectID:str = "" | ||
| SelectedItem:Dict = field(default_factory = {"MethodName": "", "Parameters": [], "TypeName": ""}) |
Contributor
There was a problem hiding this comment.
according to claude this is going raise TypeError: 'set' object is not callable.
Comment on lines
150
to
152
| return {"$date": bson_unix_ticks(o.to_pydatetime(), True)} | ||
| elif isinstance(o, datetime): | ||
| return {"$date": bson_unix_ticks(o, True)} |
Contributor
There was a problem hiding this comment.
are you now using timezone aware in bson_unix_ticks , I believe this would now cause a TypeError
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: Depends on
Issues addressed by this PR
Closes #260
see issue, this fixes the problem where applicable across the toolkit.
Also fixed deprecation warnings for
datetime.utcnow()(as the method was being changed anyway) and fixed anywhere that it was being called directly with non timezone aware datetimes.Test files
run the python unit test scripts.
Changelog
Additional comments