Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: factorisation d'un copié-collé #1640

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Guilouf
Copy link
Collaborator

@Guilouf Guilouf commented Jan 21, 2025

Quoi ?

Au départ c'était pour investiguer un bug sentry: https://inclusion.sentry.io/issues/13810452/?project=4508410616348752&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D&referrer=issue-stream&statsPeriod=7d&stream_index=2
avant une éventuelle correction il fallait factoriser le code

Pourquoi ?

Le code était dupliqué entre les 2 commandes

Comment ?

Factoriser le code. L'issue sentry est probablement lié à un paramétrage de batch_size, mais pas directement lié au code

@Guilouf Guilouf added the enhancement New feature or request label Jan 21, 2025
@Guilouf Guilouf self-assigned this Jan 21, 2025
@Guilouf Guilouf changed the title Factorize copy paste feat: factorisation d'un copié-collé Jan 21, 2025
@Guilouf Guilouf marked this pull request as ready for review January 21, 2025 09:10
FIELDS_TO_BULK_UPDATE = []
CLIENT = None

IS_TAGET_KEY = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IS_TARGET_KEY je pense, non ?

# call api is in qpv
result_is_in_qpv = self.is_in_target(siae.latitude, siae.longitude, client=self.CLIENT)
self.success_count["etablissement"] += 1
siae.is_qpv = result_is_in_qpv[self.IS_TAGET_KEY]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça ne fonctionne pas ici, quand c'est pour la commande ZRR, c'est les champs ZRR de la siae qui doivent être mis à jour ("siae.is_zrr", "api_zrr_last_sync_date", zzr_code, zrr_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants