database_prefix deprecation warning says "will be removed in DataJoint 2.3", but the setting is still present in 2.3.x
Mantenedores costumam responder em até 6 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Documentação
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- mysql, postgresql, python
- Domínio
- databases, documentation
Direção de pesquisa
Read how-to/deploy-production.md and reference/configuration.md, then compare their database_prefix guidance with the warning emitted by Schema.activate() and the setting in DatabaseSettings. Decide which deprecation schedule the maintainers want before changing the warning or docs; the issue presents two alternatives. Done when the code and documentation agree and production guidance no longer presents the deprecated setting as a normal recommendation.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
database.database_prefix has been deprecated since 2.2.1. When it is set, Schema.activate() warns:
DeprecationWarning: database_prefix is deprecated and will be removed in DataJoint 2.3. Use database.name to select a PostgreSQL database instead.
The 2.3 releases have shipped (up to 2.3.5), and the setting is still there. dj.config.database.database_prefix and the DJ_DATABASE_PREFIX environment variable are both still accepted, and the warning still names 2.3 as the removal release. No release note gives a different schedule.
The warning is the only place the library reads the value. It is never applied to schema names, so dj.Schema("subject") activates subject whether or not a prefix is set. Users only get a prefix by adding it to schema names in their own code.
The documentation repeats the outdated schedule:
how-to/deploy-production.md, "Use Database Prefixes": a "Deprecated in 2.2.1" note saysdatabase_prefix"will be removed in 2.3". The section below it still teaches setting the prefix and building schema names from it.- The same page also uses it in production examples:
DJ_DATABASE_PREFIX=prod_in the environment and container examples, a verification script that reports an error whendatabase_prefixis unset, and the development/production summary table. reference/configuration.mdmarks the setting as deprecated without a version.
Reproduction
Against any fresh schema on DataJoint 2.3.x:
import warnings
import datajoint as dj
dj.config.database.database_prefix = "myproject_"
warnings.simplefilter("always", DeprecationWarning)
schema = dj.Schema("prefix_check") # activates the schema and emits the warning
@schema
class Subject(dj.Manual):
definition = """
subject_id : int32
---
subject_name : varchar(64)
weight : float64
"""
print(dj.__version__) # 2.3.x
print(dj.config.database.database_prefix) # 'myproject_' (setting still accepted)
print(schema.database) # 'prefix_check' (prefix not applied)
Output (shown on a 2.3.5 development build):
DeprecationWarning: database_prefix is deprecated and will be removed in DataJoint 2.3. Use database.name to select a PostgreSQL database instead.
2.3.5...
myproject_
prefix_check
Expected behavior
The warning should name a release that has not shipped yet, or not name one at all. The documentation should give the same schedule as the code, and production guides should not recommend a deprecated setting as a normal production setting.
Options
These are two ways to fix it, and this issue does not pick one.
- Remove it in 2.4 on a stated schedule. On
master, change the warning to "will be removed in DataJoint 2.4" so 2.3.x users get an accurate notice. Onnext, remove the setting: thedatabase_prefixfield inDatabaseSettings, theDJ_DATABASE_PREFIXmapping, and the check inSchema.activate(). Record the removal in the 2.4 release notes. In the docs, replace the "Use Database Prefixes" section and the production examples with the recommended alternative, keeping in mind thatdatabase.nameselects a PostgreSQL database and has no direct MySQL equivalent. - Correct the message and keep the setting for now. Change the warning to say the setting is deprecated and will be removed in a future release, or name a release once one is agreed. Make the docs say the same thing, and remove
database_prefixfrom the production checklist, the example environments, and the summary table so the docs no longer recommend it.
With either option, the deprecation note in how-to/deploy-production.md and the entry in reference/configuration.md should match whatever the code says.
- Linguagem predominante
- Python
- Estrelas
- 198
- Forks
- 103
- Merge médio
- 6d 1h
- PRs com merge (30d)
- 10
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de datajoint/datajoint-python
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
datajoint/datajoint-python#1703 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
datajoint/datajoint-python#1702 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
datajoint/datajoint-python#1701 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
datajoint/datajoint-python#1691 ·
Mantenedores costumam responder em até 6 dias
-
dependencies needs-discussion
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
datajoint/datajoint-python#1687 ·
Mantenedores costumam responder em até 6 dias
Todas as issues de datajoint/datajoint-python
Issues semelhantes
-
needs-triage
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
gke-labs/kube-agents#6620 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
open-webui/open-webui#34719 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
cognition
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
One non-object JSON record makes the session catalog exitTalvez já em andamento @he-yufeng assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
collabnix/awesome-mcp-lists#433 ·
Mantenedores costumam responder em até 4 dias