feat: adicionar handler Meta Ad Library#54
Merged
Conversation
… Library - Substitui `assert self.session is not None` por RuntimeError explícito em `_request()` — assert é eliminado com flag -O do Python, deixando um AttributeError opaco no lugar de uma mensagem legível - Remove NOT_BETWEEN do check inicial de `_extract_delivery_date_bounds()`: o operador não tem mapeamento para os parâmetros da API da Meta e nunca marcava `condition.applied = True`, comportamento correto mas acidental; agora cai no branch else, retorna None no _coerce_date e é ignorado explicitamente, ficando para filtragem local do MindsDB - Colapsa os branches idênticos de list/tuple em `_coerce_to_list()` em um único isinstance(value, (list, tuple)) - Adiciona test_check_connection_fails_when_no_search_scope: cobre o caminho de 400 da API da Meta quando nenhum search_page_ids nem search_terms é fornecido na connection_data Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexto
Handler para consultar dados públicos da Meta Ad Library via `https://graph.facebook.com/<api_version>/ads_archive`. Parte da story SC-76058, que entrega o conector `meta_ad_library` no Data Agent com token gerenciado pela Talentify.
O que foi implementado
Arquitetura e decisões
O token é passado via `connection_data` — sem OAuth na V1. O handler lê `access_token` de `connection_data` e o injeta nas requests à API da Meta. No lado do `mktplace`, o token é gerenciado pela plataforma e nunca exposto ao usuário final (ver PR correspondente no mktplace).
A lógica de "não pré-limitar quando há filtros locais pendentes" fica em `ads_table.py` após `_build_request_params`, verificando se o conjunto de condições originais ainda tem filtros não traduzidos para a API.
Correções pós-review
Pontos de atenção