Hi, I currently develop a custom tool for Google Admobs, and I’m a bit confusing about schema part.
There a quite long list questions but hope someone can help me out!
1. Question 1:
When declare schema of each stream. Does it need to be exactly the API reponse.
For example:
Here is Google Admobs API Response
[{
"header": {
"dateRange": {
"startDate": {"year": 2018, "month": 9, "day": 1},
"endDate": {"year": 2018, "month": 9, "day": 1}
},
"localizationSettings": {
"currencyCode": "USD",
"languageCode": "en-US"
}
}
},
{
"row": {
"dimensionValues": {
"DATE": {"value": "20180918"},
"APP": {
"value": "ca-app-pub-8123415297019784~1001342552",
displayLabel: "My app name!"
}
},
"metricValues": {
"ESTIMATED_EARNINGS": {"microsValue": 6500000}
}
}
},
{
"footer": {"matchingRowCount": 1}
}]
Does my schema need to be like
networkschema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [],
"properties": {
"header": {
"type": "object",
"properties":{
"dateRange": {
"type": "object",
"properties":{
"startDate":{
"type": "object",
"properties":{
"year": {"type": ["null", "number"]},
"month": {"type": ["null", "number"]},
"day": {"type": ["null", "number"]}
}
(and so on)
Or it just needs to be the output of fields in the format that I want?
"properties": {
"DATE": {"type": ["null", "string"]},
"APP": {"type": ["null", "string"]},
"APP_NAME":{"type": ["null", "string"]},
"ESTIMATED_EARNINGS":{"type": ["null", "number"]}
}
2. Question 2
If the stream’s schema, which is the result of get_json_schema fuction, is different from source in term of number of fields, can airbyte still discover the stream
Because currently airbyte seems not to detect my stream, I will explain in question 3.
3. Question 3
I try to develop a custom report, in which users can input their wanted dimensions and metrics.
But airbyte cannot detect the stream of those custom report.
Therefore, I wonder:
- If users don’t input anything in custom report dimension and metrics, do the config get like this
{
"publisher_id":"abc",
"client_id": "abc",
"client_secret":"abc",
"refresh_token": "abc",
"start_date": "2022-10-25",
"custom_report_dimensions": [],
"custom_report_metrics": []
}
or like this
{
"publisher_id":"abc",
"client_id": "abc",
"client_secret":"abc",
"refresh_token": "abc",
"start_date": "2022-10-25"
}
This question is for the code that I’m aiming
if "custom_report_metrics" in config:
custom_streams = self.generate_custom_streams(authenticator=auth, config=config)
streams.extend(custom_streams)
or
if config.get("custom_report_metrics"):
custom_streams = self.generate_custom_streams(authenticator=auth, config=config)
streams.extend(custom_streams)
and finally, I choose those custom report dimensions and metrics is array type with enum.
custom_report_metrics:
title: Custom Reports Metrics
description: Pick iteams in list
type: array
order: 2
minItems: 0
uniqueItems: true
items:
type: string
enum:
- AD_REQUESTS
- MATCHED_REQUESTS
- SHOW_RATE
- MATCH_RATE
- CLICKS
- ESTIMATED_EARNINGS
- IMPRESSIONS
- IMPRESSION_CTR
- IMPRESSION_RPM
With this spec config, do they return a list like
"custom_report_dimensions": ["DATE"],
"custom_report_metrics": ["CLICKS"]
or different format?
4. Question 4
What is the purpose of Advanced_auth or authSpecification?.
They help us to verify the format of authentication input by users?