Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1265344 > unrolled thread

Bug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18

Started byBas Couwenberg <sebastic@xs4all.nl>
First post2025-10-09 07:10 +0200
Last post2025-10-22 11:10 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.debian.bugs.dist


Contents

  Bug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18 Bas Couwenberg <sebastic@xs4all.nl> - 2025-10-09 07:10 +0200
    Bug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18 Colin Watson <cjwatson@debian.org> - 2025-10-19 02:00 +0200
      Bug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18 "Chris Lamb" <lamby@debian.org> - 2025-10-22 01:10 +0200
        Bug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18 Colin Watson <cjwatson@debian.org> - 2025-10-22 11:10 +0200

#1265344 — Bug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18

FromBas Couwenberg <sebastic@xs4all.nl>
Date2025-10-09 07:10 +0200
SubjectBug#1117647: python-django-postgres-extra: autopkgtest failure with postgresql-common (284) / postgresql-18
Message-ID<LDR4B-3PdS-1@gated-at.bofh.it>
Source: python-django-postgres-extra
Version: 2.0.9-1
Severity: serious
Justification: autopkgtest failure

Dear Maintainer,

The autopkgtest of your package is failing with postgresql-common (284) which depends on postgresql-18:

 77s =================================== FAILURES ===================================
 77s ___________________ test_schema_editor_clone_model_to_schema ___________________
 77s 
 77s fake_model = <class 'tests.fake_model.D51210B1'>
 77s fake_model_fk_target_1 = <class 'tests.fake_model.2886Ea25'>
 77s fake_model_fk_target_2 = <class 'tests.fake_model.7Fb4D0D9'>
 77s 
 77s     @pytest.mark.skipif(
 77s         django.VERSION < (3, 2),
 77s         reason=django_32_skip_reason,
 77s     )
 77s     @pytest.mark.django_db(transaction=True)
 77s     def test_schema_editor_clone_model_to_schema(
 77s         fake_model, fake_model_fk_target_1, fake_model_fk_target_2
 77s     ):
 77s         """Tests that cloning a model into a separate schema without obtaining
 77s         AccessExclusiveLock on the source table works as expected."""
 77s     
 77s         schema_editor = PostgresSchemaEditor(connection)
 77s     
 77s         with schema_editor:
 77s             schema_editor.alter_table_storage_setting(
 77s                 fake_model._meta.db_table, "autovacuum_enabled", "false"
 77s             )
 77s     
 77s         table_name = fake_model._meta.db_table
 77s         source_schema_name = "public"
 77s         target_schema_name = _create_schema()
 77s     
 77s         with schema_editor:
 77s             schema_editor.clone_model_structure_to_schema(
 77s                 fake_model, schema_name=target_schema_name
 77s             )
 77s     
 77s             assert _list_lock_modes_in_schema(source_schema_name) == {
 77s                 "AccessShareLock"
 77s             }
 77s     
 77s >       _assert_cloned_table_is_same(
 77s             (source_schema_name, table_name),
 77s             (target_schema_name, table_name),
 77s             excluding_constraints_and_indexes=True,
 77s         )
 77s 
 77s tests/test_schema_editor_clone_model_to_schema.py:236: 
 77s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 77s /usr/lib/python3.13/contextlib.py:85: in inner
 77s     return func(*args, **kwds)
 77s            ^^^^^^^^^^^^^^^^^^^
 77s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 77s 
 77s source_table_fqn = ('public', 'tests_d51210b1')
 77s target_table_fqn = ('06e2d136', 'tests_d51210b1')
 77s excluding_constraints_and_indexes = True
 77s 
 77s     @transaction.atomic
 77s     def _assert_cloned_table_is_same(
 77s         source_table_fqn: Tuple[str, str],
 77s         target_table_fqn: Tuple[str, str],
 77s         excluding_constraints_and_indexes: bool = False,
 77s     ):
 77s         source_schema_name, source_table_name = source_table_fqn
 77s         target_schema_name, target_table_name = target_table_fqn
 77s     
 77s         source_columns = db_introspection.get_columns(
 77s             source_table_name, schema_name=source_schema_name
 77s         )
 77s         target_columns = db_introspection.get_columns(
 77s             target_table_name, schema_name=target_schema_name
 77s         )
 77s         assert source_columns == target_columns
 77s     
 77s         source_relations = db_introspection.get_relations(
 77s             source_table_name, schema_name=source_schema_name
 77s         )
 77s         target_relations = db_introspection.get_relations(
 77s             target_table_name, schema_name=target_schema_name
 77s         )
 77s         if excluding_constraints_and_indexes:
 77s             assert target_relations == {}
 77s         else:
 77s             assert source_relations == target_relations
 77s     
 77s         source_constraints = db_introspection.get_constraints(
 77s             source_table_name, schema_name=source_schema_name
 77s         )
 77s         target_constraints = db_introspection.get_constraints(
 77s             target_table_name, schema_name=target_schema_name
 77s         )
 77s         if excluding_constraints_and_indexes:
 77s >           assert target_constraints == {}
 77s E           AssertionError: assert {'tests_d5121...ne, ...}, ...} == {}
 77s E             
 77s E             Left contains 7 more items:
 77s E             {'tests_d51210b1_age_not_null': {'check': False,
 77s E                                              'columns': ['age'],
 77s E                                              'definition': None,
 77s E                                              'foreign_key': None,
 77s E                                              'index': False,...
 77s E             
 77s E             ...Full output truncated (52 lines hidden), use '-vv' to show
 77s 
 77s tests/test_schema_editor_clone_model_to_schema.py:72: AssertionError

https://ci.debian.net/packages/p/python-django-postgres-extra/testing/amd64/65001064/

[toc] | [next] | [standalone]


#1266598

FromColin Watson <cjwatson@debian.org>
Date2025-10-19 02:00 +0200
Message-ID<LHp05-6erb-1@gated-at.bofh.it>
In reply to#1265344
Control: reassign -1 python3-django
Control: affects -1 src:python-django-postgres-extra

On Thu, Oct 09, 2025 at 07:04:52AM +0200, Bas Couwenberg wrote:
>Source: python-django-postgres-extra
>Version: 2.0.9-1
>Severity: serious
>Justification: autopkgtest failure
>
>Dear Maintainer,
>
>The autopkgtest of your package is failing with postgresql-common (284) which depends on postgresql-18:
[...]
> 77s         if excluding_constraints_and_indexes:
> 77s >           assert target_constraints == {}
> 77s E           AssertionError: assert {'tests_d5121...ne, ...}, ...} == {}
> 77s E
> 77s E             Left contains 7 more items:
> 77s E             {'tests_d51210b1_age_not_null': {'check': False,
> 77s E                                              'columns': ['age'],
> 77s E                                              'definition': None,
> 77s E                                              'foreign_key': None,
> 77s E                                              'index': False,...
> 77s E
> 77s E             ...Full output truncated (52 lines hidden), use '-vv' to show
> 77s
> 77s tests/test_schema_editor_clone_model_to_schema.py:72: AssertionError
>
>https://ci.debian.net/packages/p/python-django-postgres-extra/testing/amd64/65001064/

I think this was caused by 
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=14e87ffa5, 
but looking at the implementation of this test, it would need a change 
to Django for django-postgres-extra to be able to filter out not-null 
constraints here.  And when I looked into what that would involve in 
Django, I found this:

   https://github.com/django/django/pull/19910

I tried cherry-picking that and confirmed that it fixes 
django-postgres-extra's tests.  Chris, does cherry-picking this into the 
version of Django in unstable sound reasonable to you?  I'm happy to do 
the work - just wanted to get a second opinion.

Thanks,

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]

[toc] | [prev] | [next] | [standalone]


#1266981

From"Chris Lamb" <lamby@debian.org>
Date2025-10-22 01:10 +0200
Message-ID<LItEl-6XZX-5@gated-at.bofh.it>
In reply to#1266598
Colin Watson wrote:

> […] but looking at the implementation of this test, it would need a change 
> to Django for django-postgres-extra to be able to filter out not-null 
> constraints here.  And when I looked into what that would involve in 
> Django, I found this:
>
>    https://github.com/django/django/pull/19910

Yep, cherry-picking this into the version in unstable (3:4.2.25-1 at the
time of writing) looks good to me. Happy to do it if you are a bit busy,
though.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org 🍥 chris-lamb.co.uk
       `-

[toc] | [prev] | [next] | [standalone]


#1267023

FromColin Watson <cjwatson@debian.org>
Date2025-10-22 11:10 +0200
Message-ID<LID10-74gP-27@gated-at.bofh.it>
In reply to#1266981
On Tue, Oct 21, 2025 at 03:59:51PM -0700, Chris Lamb wrote:
>Colin Watson wrote:
>> […] but looking at the implementation of this test, it would need a change
>> to Django for django-postgres-extra to be able to filter out not-null
>> constraints here.  And when I looked into what that would involve in
>> Django, I found this:
>>
>>    https://github.com/django/django/pull/19910
>
>Yep, cherry-picking this into the version in unstable (3:4.2.25-1 at the
>time of writing) looks good to me. Happy to do it if you are a bit busy,
>though.

Thanks - done.

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web