Hey all. Did some further testing over the weekend...
# troubleshooting
p
Hey all. Did some further testing over the weekend, implementing some of the suggestions from @taylor and @pat_nadolny. My meltano.yml now looks like
plugins:
extractors:
- name: tap-facebook
catalog: extract/tap-facebook.json
variant: singer-io
pip_url: git+<https://github.com/singer-io/tap-facebook.git>
config:
account_id: ''
start_date: 01/24/2023
end_date: 01/26/2023
insights_buffer_days: 0
include_deleted: true
select:
- adcreative.*
the attached. I've run an invoke --dump=catalog for the extractor to a file called "facebook.json", which is now referenced in the meltano.yml included above, and updated the tap-facebook.json to include the json as seen here:
{
"filters": {
"type": [
"null",
"array"
],
"items": {
"type": [
"null",
"string"
]
}
},
"streams": [
{
"stream": "adcreative",
"tap_stream_id": "adcreative",
"schema": {
"properties": {
"body": {
"type": [
"null",
"string"
]
from there, running a
meltano invoke tap-facebook
seems to pull all of the "adcreative" data, but bombs on the following, in "ads" ```INFO Syncing adcreative, fields {'id'} INFO Syncing ads, fields {'updated_time', 'id'} INFO METRIC: {"type": "counter", "metric": "record_count", "value": 0, "tags": {"endpoint": "ads"}} ERROR 'bool' object has no attribute 'lower' Traceback (most recent call last): File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 926, in main main_impl() File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 917, in main_impl do_sync(account, catalog, args.state) File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 806, in do_sync for message in stream: File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 336, in iter if CONFIG.get('include_deleted', 'false').lower() == 'true': AttributeError: 'bool' object has no attribute 'lower' CRITICAL 'bool' object has no attribute 'lower' Traceback (most recent call last): File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/bin/tap-facebook", line 8, in <module> sys.exit(main()) File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 934, in main raise e File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 926, in main main_impl() File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 917, in main_impl do_sync(account, catalog, args.state) File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 806, in do_sync for message in stream: File "/Users/pierre.semaan/SemaforWork/semafor-data-meltano/semafor-data-pipeline/.meltano/extractors/tap-facebook/venv/lib/python3.9/site-packages/tap_facebook/__init__.py", line 336, in iter if CONFIG.get('include_delete…
t
it looks like it’s a bug with the tap. It’s attempting to lowercase a boolean and it bombs on that.
it’s possible thought that by telling meltano to treat it as a string then it would fix it. if you add:
Copy code
settings:
  - name: include_deleted
    kind: string
to your meltano.yml for tap-facebook you can override that setting and see what the effect is
p
So, I have a question. My extract/tap-facebook.json has all stream entities and attributes from facebook ads. This seems to be superceding what I define in the meltano.yml, as it pulls adcreative, even though I only want the ads.* stuff ... Did I implement the settings change correctly?
Copy code
INFO Syncing adcreative, fields {'id'}
INFO Syncing ads, fields {'id', 'updated_time'}
INFO METRIC: {"type": "counter", "metric": "record_count", "value": 0, "tags": {"endpoint": "ads"}}
ERROR 'bool' object has no attribute 'lower'
Traceback (most recent call last):
t
you would still need the
include_deleted: true
in your config. The
setting
redefines what it is, and then the
config
sets the value.
p
One other thing to consider is using an alternative bigquery target to see if that helps. @alexander_butler built a pretty robust SDK based target-bigquery intending to fix some of these types of issues. He's been using it in production for a while but we just put it up on MeltanoHub a few days ago
p
Appreciate that. Even with your suggestions, I'm still not able to get past the "
Copy code
NFO METRIC: {"type": "counter", "metric": "record_count", "value": 0, "tags": {"endpoint": "ads"}}
ERROR 'bool' object has no attribute 'lower'"
Writing to BigQuery isn't even an issue yet, as we can't grab the data, even to a text file
p
ahh ok so it looks like the tap is expecting a string version of the boolean like Taylor mentioned. I can override it in the meltano hub definition so its fixed for everyone https://github.com/meltano/hub/pull/1142. If you run
meltano lock tap-facebook --update
it should refresh your settings metadata for that tap
I'm curious if that will help
p
is it an issue for everyone? I don't want to break it for everyone. We're locked to V15 of Facebook because we are a relatively new app - our site launched on October 28th, so we can't revert to version 14 and test that, if that makes sense?
p
I confirmed that the tap is expecting a string version of a boolean and the meltano definition was casting it to a boolean, so anyone trying to use that setting would have the same issue. Its likely that most people just accept the default so they never run into this issue but not sure 🤔
p
so maybe I'm missing something, but even if "include_deleted" is not there in the meltano.yml, running
meltano invoke tap-facebook > fb_ads.txt
still bombs. Should it be running that check?
also, ran "meltano lock tap-facebook --update" and it's still an issue. Maybe I've incorrectly defined something
this is my current tap state for dev:
- name: tap-facebook
variant: singer-io
pip_url: git+<https://github.com/singer-io/tap-fpacebook.git>
settings:
- name: include_deleted
kind: string
config:
account_id: ''
start_date: 01/24/2023
end_date: 01/26/2023
insights_buffer_days: 0
include_deleted: true
catalog: extract/tap-facebook.json
select:
- ads.*
p
if your lock command worked then you should be able to remove the
settings:
section from your meltano.yml. You can validate that your config is indeed being populated with a string enclosed in quotes if you run
meltano config tap-facebook
p
Copy code
{
  "account_id": "",
  "access_token": "",
  "start_date": "01/24/2023",
  "end_date": "01/26/2023",
  "insights_buffer_days": 0,
  "include_deleted": true
}
but now I'm in timeout from Facebook polling for 90-ish minutes! 🤣
p
ahh ok so you'll need to update the
include_deleted: true
to
include_deleted: 'true'
. I thought meltano would do that automatically but I guess not
hahah but yeah the facebook rate limits are a whole other beast
p
I asked my boss to do it. We're still running on the principle of least privilege, which is fine, but still a process
so, my exported catalog json has all entities and attributes. Is that why if I have this
select:
- ads.*
and I try running "`meltano invoke tap-facebook > fb_ads.txt`" it queries "adcreative" first, since it's defined in the .json?
p
check out the docs on catalogs https://docs.meltano.com/guide/integration#extractor-catalog-generation. That should clarify whats going on 😄
p
so, it's ignroing my inclusion patter of
ads.**,
and falling back to the
If no rules are defined using meltano select, Meltano will fall back on catch-all rule *.* so that all entities and attributes are selected.
until it bombed on ads.*, the second in the list, after adcreative ...