Giter Club home page Giter Club logo

Comments (15)

tadobe123 avatar tadobe123 commented on August 26, 2024 1

Hi konosp,

Thanks for your reply. Yes it works !!!! thanks a lot.

Just FYI got the below value with item id 0 than actual dimension values showing up.

Dimension variables/evar2, Item ID: 0
Analytics Debugger End
Analytics Debugger Start
{"totalPages":1,"firstPage":false,"lastPage":false,"numberOfElements":0,"number":2,"totalElements":2,"columns":{"dimension":{"id":"variables/evar2","type":"string"},"columnIds":["0","1","2","3","4"]},"rows":[],"summaryData":{"filteredTotals":[503.0,0.0,84559.0,0.0,0.0],"totals":[503.0,0.0,84559.0,0.0,0.0]}}

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123 ,

When you want to download a report with a single breakdown, can you please try the following instead?

aa.add_metric(metric_name= 'metrics/visits')
aa.add_metric(metric_name= 'metrics/orders')
aa.add_metric(metric_name= 'metrics/event1')
aa.add_dimension(dimension_name = 'variables/mobiledevicetype')
data = aa.get_report()

The aa.get_report_breakdown is invoked internally in the package (ideally should be private method).

Let me know if the above helps you

from adobe-analytics-reports-api-v2.0.

tadobe123 avatar tadobe123 commented on August 26, 2024

Thanks you so much for replying ...

I want to download a report with two dimensions/breakdown ...

when I try to run a report with a single dimension/breakdown(variables/evar1) it works ...

It also works with two different dimensions (evar2 and evar3)using get_report_multiple_breakdowns but the problem is when I use variables/evar1 and variables/evar2 and think it is due to having space ' ' in itemid for evar1 and failing in the sorting method.

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123,

Thanks for the details. This is odd. The itemId is always returned by the API and should never be empty string ("").
Screenshot 2020-10-16 at 22 40 31

When you view the same report in Adobe Analytics/Workspace, are you able to view the data properly?

from adobe-analytics-reports-api-v2.0.

tadobe123 avatar tadobe123 commented on August 26, 2024

yeah I am able to view it on the workspace.

Just to make it clear it's my assumption that there is itemid that has ' ' because when I google the error (https://stackoverflow.com/questions/38134643/data-frame-object-has-no-attribute)... maybe I am completely wrong.

below is the full error.

Traceback (most recent call last):
File "abc.py", line 62, in
data = aa.get_report_multiple_breakdowns()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 348, in get_report_multiple_breakdowns
results_broken_down = df_page.apply(self.get_report_breakdown, axis = 1 , dimensions = current_dimensions, current_level = level)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/frame.py", line 6878, in apply
return op.get_result()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/apply.py", line 186, in get_result
return self.apply_standard()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/apply.py", line 296, in apply_standard
values, self.f, axis=self.axis, dummy=dummy, labels=labels
File "pandas/_libs/reduction.pyx", line 620, in pandas._libs.reduction.compute_reduction
File "pandas/_libs/reduction.pyx", line 128, in pandas._libs.reduction.Reducer.get_result
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/apply.py", line 113, in f
return func(x, *args, **kwds)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 402, in get_report_breakdown
results = self.get_report(custom_report_object=tmp_report_object)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 289, in get_report
df_data = self.format_output(data)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 452, in format_output
metrics_column = df_response_data.data.tolist()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/generic.py", line 5274, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'data'

same code ran again
File "abc.py", line 62, in
data = aa.get_report_multiple_breakdowns()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 348, in get_report_multiple_breakdowns
results_broken_down = df_page.apply(self.get_report_breakdown, axis = 1 , dimensions = current_dimensions, current_level = level)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/frame.py", line 6878, in apply
return op.get_result()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/apply.py", line 186, in get_result
return self.apply_standard()
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/apply.py", line 296, in apply_standard
values, self.f, axis=self.axis, dummy=dummy, labels=labels
File "pandas/_libs/reduction.pyx", line 620, in pandas._libs.reduction.compute_reduction
File "pandas/_libs/reduction.pyx", line 128, in pandas._libs.reduction.Reducer.get_result
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/pandas/core/apply.py", line 113, in f
return func(x, *args, **kwds)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 402, in get_report_breakdown
results = self.get_report(custom_report_object=tmp_report_object)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 295, in get_report
data = self._get_page(custom_report_object)
File "/home/abc-admin/anaconda3/envs/py3/lib/python3.6/site-packages/analytics/mayhem/adobe.py", line 275, in _get_page
raise ValueError('Response code error', page.text)
ValueError: ('Response code error', '')

really appreciate your help.

from adobe-analytics-reports-api-v2.0.

tadobe123 avatar tadobe123 commented on August 26, 2024

I guess the question is if it is working with two dimension why is it not working for a particular dimension .... what steps I can take to resolve it

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123 , I will have to add some extensive logging functionality so we can review the kind of responses you receive from the API. Without those, it will be hard to understand what is going wrong. Will create a dedicated branch for the issue and will come back here to let you know to install that particular version.

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123 ,

Have created a new branch that will generate additional logging. To install it, please perform the below:

  1. Uninstall the local package by running pip uninstall analytics-mayhem-adobe
  2. Install the staging branch by running pip install git+https://github.com/konosp/adobe-analytics-reports-api-v2.0.git@response_logging
  3. When you initiate the client, add the additional flag aa = analytics_client(<arguments>, debugging=True)

The above will create an additional file named logs. The file will contain both the request objects and the response data from the API. Please review them so they do not contain any information you would like not to share and upload them here. This will help me understand what data you receive from the API. It might be an edge case that I have not seen before.

Let me know how the above goes.

from adobe-analytics-reports-api-v2.0.

tadobe123 avatar tadobe123 commented on August 26, 2024

Thanks for your response .... Will do it tomm

from adobe-analytics-reports-api-v2.0.

tadobe123 avatar tadobe123 commented on August 26, 2024

there are two dim :- evar1 5k values and evar2 has only 2 value (abc and dad).

1. when i run with evar1 and then evar 2 below is the output. Getting all the values of evar 1.

aa.add_dimension(dimension_name = 'variables/evar1')
aa.add_dimension(dimension_name = 'variables/evar2')

output.

Analytics Debugger Start
------------------- Data --------------------------------------------------------------------------------------------------------------------------------------------
Analytics Debugger End
Analytics Debugger Start
Parsing page 1
Analytics Debugger End
Analytics Debugger Start
------------------- Data --------------------------------------------------------------------------------------------------------------------------------------------
Analytics Debugger End
Analytics Debugger Start
Parsing page 2
Analytics Debugger End
Analytics Debugger Start
------------------- Data --------------------------------------------------------------------------------------------------------------------------------------------
Analytics Debugger End
Analytics Debugger Start
Downloading additional breakdown
Analytics Debugger End
Analytics Debugger Start
['variables/evar2']
Analytics Debugger End
Analytics Debugger Start
Dimension variables/evar2, Item ID: 0
Analytics Debugger End
Analytics Debugger Start
{"totalPages":1,"firstPage":false,"lastPage":false,"numberOfElements":0,"number":2,"totalElements":2,"columns":{"dimension":{"id":"variables/evar2","type":"string"},"columnIds":["0","1","2","3","4"]},"rows":[],"summaryData":{"filteredTotals":[503.0,0.0,84559.0,0.0,0.0],"totals":[503.0,0.0,84559.0,0.0,0.0]}}

Analytics Debugger End
Traceback (most recent call last):
File "daily_go_devices_adobe_raw.py", line 61, in
data = aa.get_report_multiple_breakdowns()
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/analytics/mayhem/adobe.py", line 349, in get_report_multiple_breakdowns
results_broken_down = df_page.apply(self.get_report_breakdown, axis = 1 , dimensions = current_dimensions, current_level = level)
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 6878, in apply
return op.get_result()
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/pandas/core/apply.py", line 186, in get_result
return self.apply_standard()
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/pandas/core/apply.py", line 296, in apply_standard
values, self.f, axis=self.axis, dummy=dummy, labels=labels
File "pandas/_libs/reduction.pyx", line 620, in pandas._libs.reduction.compute_reduction
File "pandas/_libs/reduction.pyx", line 128, in pandas._libs.reduction.Reducer.get_result
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/pandas/core/apply.py", line 113, in f
return func(x, *args, **kwds)
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/analytics/mayhem/adobe.py", line 403, in get_report_breakdown
results = self.get_report(custom_report_object=tmp_report_object)
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/analytics/mayhem/adobe.py", line 290, in get_report
df_data = self.format_output(data)
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/analytics/mayhem/adobe.py", line 453, in format_output
metrics_column = df_response_data.data.tolist()
File "/Users/abc/opt/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'data'

senario2

when i run with evar2 and then evar1 below is the output, pls note that the values of evar2 are getting populated. Also if you see DIMENSION VARIABLES/EVAR1, ITEM ID: 44444444 item ID 44444444 is the value

aa.add_dimension(dimension_name = 'variables/evar2')
aa.add_dimension(dimension_name = 'variables/evar1')

Analytics Debugger Start
{"totalPages":1,"firstPage":true,"lastPage":true,"numberOfElements":2,"number":0,"totalElements":2,"columns":{"dimension":{"id":"variables/evar2","type":"string"},"columnIds":["0","1","2","3","4"]},"rows":[{"itemId":"44444444","value":"abc","data":[316942.0,232993.0,2.25806444E9,3.2608592566666666E7,1143854.0]},{"itemId":"44444333","value":"dad","data":[129283.0,100414.0,1.435671165E9,2.31770276E7,622681.0]}],"summaryData":{"filteredTotals":[446225.0,333407.0,3.693735605E9,5.578562016666666E7,1766535.0],"totals":[446225.0,333407.0,3.693735605E9,5.578562016666666E7,1766535.0]}}
Analytics Debugger End
Analytics Debugger Start
Downloading additional breakdown
Analytics Debugger End
Analytics Debugger Start
['variables/evar1']
Analytics Debugger End
Analytics Debugger Start
DIMENSION VARIABLES/EVAR1, ITEM ID: 44444444
Analytics Debugger End
Analytics Debugger Start
------------------- Data --------------------------------------------------------------------------------------------------------------------------------------------
Analytics Debugger End
Analytics Debugger Start
Parsing page 1
Analytics Debugger End
Analytics Debugger Start
------------------- Data --------------------------------------------------------------------------------------------------------------------------------------------
Analytics Debugger End
Analytics Debugger Start
Parsing page 2
Analytics Debugger End
Analytics Debugger Start
------------------- Data --------------------------------------------------------------------------------------------------------------------------------------------
Analytics Debugger End
Analytics Debugger Start
Parsing page 3
--- goes into infinite loop

senario 3 :- just evar2.getting correct values in output.

aa.add_dimension(dimension_name = 'variables/evar2')

below is output from adobe front end.

{
"rsid": "a",
"globalFilters": [
{
"type": "dateRange",
"dateRange": "2020-01-01T00:00:00.000/2020-04-01T00:00:00.000"
}
],
"metricContainer": {
"metrics": [
{
"columnId": "0",
"id": "metrics/occurrences",
"sort": "desc"
}
]
},
"dimension": "variables/evar2",
"settings": {
"countRepeatInstances": true,
"limit": 50,
"page": 0,
"nonesBehavior": "return-nones"
},
"statistics": {
"functions": [
"col-max",
"col-min"
]
}
}

{
"totalPages": 1,
"firstPage": true,
"lastPage": true,
"numberOfElements": 2,
"number": 0,
"totalElements": 2,
"columns": {
"dimension": {
"id": "variables/evar2",
"type": "string"
},
"columnIds": [
"0"
]
},
"rows": [
{
"itemId": "44444444",
"value": "abc",
"data": [
1065933051
]
},
{
"itemId": "44444333",
"value": "dad",
"data": [
528305814
]
}
],
"summaryData": {
"filteredTotals": [
1594238865
],
"totals": [
1594238865
],
"col-max": [
1065933051
],
"col-min": [
528305814
]
}
}

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123 , thank you for all the detailed logs. I think the issue is because one of the combination of dimensions returns no data.

The below JSON response generates the error. This is not something I had managed to test.

{"totalPages":1,"firstPage":false,"lastPage":false,"numberOfElements":0,"number":2,"totalElements":2,"columns":{"dimension":{"id":"variables/evar2","type":"string"},"columnIds":["0","1","2","3","4"]},"rows":[],"summaryData":{"filteredTotals":[503.0,0.0,84559.0,0.0,0.0],"totals":[503.0,0.0,84559.0,0.0,0.0]}}

Will have to add checks for the above scenario. Will try to do this in the next few days.

from adobe-analytics-reports-api-v2.0.

tadobe123 avatar tadobe123 commented on August 26, 2024

Thanks. pls, let me know if there is anything I can help with.

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123 , added a small check in this branch that checks if the response contains data. I have not managed to test this through a proper request; only simulated.

Can you please try to repeat the steps in the comment above (#15 (comment))?

Let me know how it works.

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Hi @tadobe123 , let me know if you had the chance to look into the above. Then I can look into merging it to the main branch. Cheers!

from adobe-analytics-reports-api-v2.0.

konosp avatar konosp commented on August 26, 2024

Thanks @tadobe123! That sounds good.

I think this is because the combination of the dimensions have no items available to return. So this is expected.
But let me know if you spot any other bugs!

Cheers

from adobe-analytics-reports-api-v2.0.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.