Skip to content

use dict in Record.serialize #726

@ariel-anieli

Description

@ariel-anieli

Proposed Changes

Hello maintainers,

I have just discovered the library, it's been handy to me. I came across this change while reading the code base.

Since Python 3.7, dict preserve key insertion-order. c7132d0 got introduced after the release of Python 3.7; this assures us there won't be any regression.

I have tested this change for a PR.

Your feedback is much appreciated.

Justification

# pytest 
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.12, pytest-9.0.2, pluggy-1.6.0                
rootdir: /home/ariel/src/pynetbox            
plugins: docker-3.2.5
collected 236 items                                                                                                                                                                         
                                               
tests/integration/test_dcim.py .........................................................                                                                                              [ 24%]
tests/integration/test_ipam.py ..........................................                                                                                                             [ 41%]
tests/test_api.py ......                                                                                                                                                              [ 44%]
tests/test_app.py ...                                                                                                                                                                 [ 45%]
tests/test_circuits.py ..............                                                                                                                                                 [ 51%]
tests/test_tenancy.py ......                                                                                                                                                          [ 54%]
tests/test_users.py .............                                                                                                                                                     [ 59%]
tests/test_virtualization.py ...............                                                                                                                                          [ 66%]
tests/test_wireless.py ....                                                                                                                                                           [ 67%]
tests/unit/test_detailendpoint.py ..                                                                                                                                                  [ 68%]
tests/unit/test_endpoint.py ...............                                                                                                                                           [ 75%]
tests/unit/test_endpoint_strict_filter.py ....                                                                                                                                        [ 76%]
tests/unit/test_extras.py ...                                                                                                                                                         [ 77%]
tests/unit/test_file_upload.py .................                                                                                                                                      [ 85%]
tests/unit/test_multiformat_endpoint.py .......                                                                                                                                       [ 88%]
tests/unit/test_query.py ...                                                                                                                                                          [ 89%]
tests/unit/test_request.py ..                                                                                                                                                         [ 90%]
tests/unit/test_response.py .......................                                                                                                                                   [100%]
                                                                                              
============================================================================== 236 passed in 177.16s (0:02:57) ==============================================================================

Metadata

Metadata

Assignees

Labels

app: pynetboxtype: housekeepingChanges to the application which do not directly impact the end user

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions