Address deprecation warnings #11703

Closed
opened 2025-12-29 21:48:48 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Oct 7, 2025).

Originally assigned to: @pheus on GitHub.

Proposed Changes

NetBox currently logs the following deprecation warnings on initialization:

$ROOT/venv/lib/python3.12/site-packages/django/db/models/fields/__init__.py:1148: RemovedInDjango60Warning: The default scheme will be changed from 'http' to 'https' in Django 6.0. Pass the forms.URLField.assume_scheme argument to silence this warning, or set the FORMS_URLFIELD_ASSUME_HTTPS transitional setting to True to opt into using 'https' as the new default scheme.
  return form_class(**defaults)
/usr/lib/python3.12/functools.py:998: DeprecationWarning: Argument name-based matching of 'info' is deprecated and will be removed in v1.0. Ensure that reserved arguments are annotated their respective types (i.e. use value: 'DirectiveValue[str]' instead of 'value: str' and 'info: Info' instead of a plain 'info').
  val = self.func(instance)
$ROOT/netbox/dcim/tables/devices.py:151: DeprecationWarning: Use '__' to separate path components, not '.' in accessor 'device_type.u_height' (fallback will be removed in django_tables2 version 3).
  class DeviceTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable):
$ROOT/venv/lib/python3.12/site-packages/django_tables2/columns/templatecolumn.py:44: DeprecationWarning: Use '__' to separate path components, not '.' in accessor 'device_type.u_height' (fallback will be removed in django_tables2 version 3).
  super().__init__(**extra)
$ROOT/netbox/extras/querysets.py:93: RemovedInDjango61Warning: The ordering argument is deprecated. Use order_by instead.
  _data=EmptyGroupByJSONBAgg('data', ordering=['weight', 'name'])

These need to be cleaned up.

Justification

These warnings indicate that current functionality will be removed or broken in the near future.

Originally created by @jeremystretch on GitHub (Oct 7, 2025). Originally assigned to: @pheus on GitHub. ### Proposed Changes NetBox currently logs the following deprecation warnings on initialization: ``` $ROOT/venv/lib/python3.12/site-packages/django/db/models/fields/__init__.py:1148: RemovedInDjango60Warning: The default scheme will be changed from 'http' to 'https' in Django 6.0. Pass the forms.URLField.assume_scheme argument to silence this warning, or set the FORMS_URLFIELD_ASSUME_HTTPS transitional setting to True to opt into using 'https' as the new default scheme. return form_class(**defaults) /usr/lib/python3.12/functools.py:998: DeprecationWarning: Argument name-based matching of 'info' is deprecated and will be removed in v1.0. Ensure that reserved arguments are annotated their respective types (i.e. use value: 'DirectiveValue[str]' instead of 'value: str' and 'info: Info' instead of a plain 'info'). val = self.func(instance) $ROOT/netbox/dcim/tables/devices.py:151: DeprecationWarning: Use '__' to separate path components, not '.' in accessor 'device_type.u_height' (fallback will be removed in django_tables2 version 3). class DeviceTable(TenancyColumnsMixin, ContactsColumnMixin, NetBoxTable): $ROOT/venv/lib/python3.12/site-packages/django_tables2/columns/templatecolumn.py:44: DeprecationWarning: Use '__' to separate path components, not '.' in accessor 'device_type.u_height' (fallback will be removed in django_tables2 version 3). super().__init__(**extra) $ROOT/netbox/extras/querysets.py:93: RemovedInDjango61Warning: The ordering argument is deprecated. Use order_by instead. _data=EmptyGroupByJSONBAgg('data', ordering=['weight', 'name']) ``` These need to be cleaned up. ### Justification These warnings indicate that current functionality will be removed or broken in the near future.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 21:48:48 +01:00
adam closed this issue 2025-12-29 21:48:48 +01:00
Author
Owner

@pheus commented on GitHub (Oct 8, 2025):

I'd like to contribute this housekeeping task. Could you please assign the issue to me? Thanks!

@pheus commented on GitHub (Oct 8, 2025): I'd like to contribute this housekeeping task. Could you please assign the issue to me? Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11703