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

[Urgent] Empty response #107

Open
ancs21 opened this issue Sep 17, 2020 · 7 comments
Open

[Urgent] Empty response #107

ancs21 opened this issue Sep 17, 2020 · 7 comments

Comments

@ancs21
Copy link

ancs21 commented Sep 17, 2020

Hello,

I had tried tap-facebook but get empty response. No error. No data. Please help. Currently, I'm working task ETL. It urgent. Thanks.

It's log:

ancs21_ps@cloudshell:~/hello-singer (mediskin-285304)$ pip3 install "https://github.com/singer-io/tap-facebook/archive/master.zip"
ancs21_ps@cloudshell:~/hello-singer (mediskin-285304)$ tap-facebook -c config.json  -d > catalog.json
INFO Loading schemas
INFO Loading schema for adcreative
INFO Loading schema for ads
INFO Loading schema for adsets
INFO Loading schema for campaigns
WARNING Property campaigns.ads is not defined in the facebook_business library
INFO Loading schema for ads_insights
INFO Loading schema for ads_insights_age_and_gender
WARNING Property ads_insights_age_and_gender.age is not defined in the facebook_business library
WARNING Property ads_insights_age_and_gender.gender is not defined in the facebook_business library
INFO Loading schema for ads_insights_country
WARNING Property ads_insights_country.country is not defined in the facebook_business library
INFO Loading schema for ads_insights_platform_and_device
WARNING Property ads_insights_platform_and_device.impression_device is not defined in the facebook_business library
WARNING Property ads_insights_platform_and_device.platform_position is not defined in the facebook_business library
WARNING Property ads_insights_platform_and_device.publisher_platform is not defined in the facebook_business library
WARNING Property ads_insights_platform_and_device.placement is not defined in the facebook_business library
INFO Loading schema for ads_insights_region
WARNING Property ads_insights_region.region is not defined in the facebook_business library
INFO Loading schema for ads_insights_dma
WARNING Property ads_insights_dma.dma is not defined in the facebook_business library
ancs21_ps@cloudshell:~/hello-singer (mediskin-285304)$ tap-facebook -c config.json -p catalog.json
ancs21_ps@cloudshell:~/hello-singer (mediskin-285304)$
@ancs21 ancs21 changed the title Empty response [Urgent] Empty response Sep 17, 2020
@maxlcoder
Copy link

this return the schema of the data,you will see the response in the file catalog.json

@ancs21
Copy link
Author

ancs21 commented Sep 29, 2020

this return the schema of the data,you will see the response in the file catalog.json

@maxlcoder Thanks for answer.

But, the catalog.json is properties. So, I don't see data on it.

@maxlcoder
Copy link

this return the schema of the data,you will see the response in the file catalog.json

@maxlcoder Thanks for answer.

But, the catalog.json is properties. So, I don't see data on it.

Oh,I see. I have done as you, there is no response too.

@maxlcoder
Copy link

@ancs21 I have solved it. I examined the code and run the code at local. Found these code:

def get_streams_to_sync(account, catalog, state):
    streams = []
    for stream in STREAMS:
        catalog_entry = next((s for s in catalog.streams if s.tap_stream_id == stream), None)
        if catalog_entry and catalog_entry.is_selected():
            # TODO: Don't need name and stream_alias since it's on catalog_entry
            name = catalog_entry.stream
            stream_alias = catalog_entry.stream_alias
            streams.append(initialize_stream(account, catalog_entry, state))
    return streams

the condition if catalog_entry and catalog_entry.is_selected() makes no response . If the catalog returns selected there will return response. So I found it's a CatalogEntry class. Then I check the class, found:

def is_selected(self):
        return self.schema.selected  # pylint: disable=no-member

So I guess maybe I change the schema in properties.json(catalog.json),the response will come. Then I edit the json file, I add the selected: true

{
    "streams": [
        {
            "stream": "adcreative",
            "tap_stream_id": "adcreative",
            "schema": {
                "properties": {
                    ...
                },  
                "type": [
                    "null",
                    "object"
                ],
                "selected": true
            },
        },


Finally , I got the response.

@ancs21
Copy link
Author

ancs21 commented Sep 30, 2020

@maxlcoder Awesome. Thank you so much.

@ageofneil
Copy link

@maxlcoder Thanks for your suggestion. After updating the schema I was able to generate a response, however it' only contains the id field (INFO Syncing adcreative, fields {'id'}). Did you remember if you encountered the same issue?

@MaxKrog
Copy link

MaxKrog commented Mar 13, 2021

Thanks @maxlcoder for pointing out the necessary addition of "selected: true" in the schema of the source.

However, as i've already force-updated my tap to use FB API v10.0 as suggested by @zenkay here:
#77

And i'm getting an error that ends with:

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 9 column 21 (char 221)

It seems to me like this package (and maybe Singer in general) is no longer a platform to build upon. Going to give Airbyte a chance instead.

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

No branches or pull requests

4 participants