Export Tool --dump-query

Hello.

I’ve been using the commcare-export tool for some time now and have found
the --dump-query flag to be quite useful. Today I tried using it and am
receiving this set of errors:

commcare-export --project spatialrepellents --query queries/form_query.xlsx
–dump-query > queries/form_query.json

Traceback (most recent call last):

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/bin/commcare-export",
line 9, in

load_entry_point('commcare-export==0.12.2', 'console_scripts', 

‘commcare-export’)()

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 197, in entry_point

main(sys.argv[1:])

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 83, in main

main_with_args(args)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 105, in main_with_args

query = excel_query.compile_workbook(workbook)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 200, in compile_workbook

queries.append(compile_sheet(workbook.get_sheet_by_name(sheet)))

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 164, in compile_sheet

source_expr = compile_source(worksheet)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 127, in compile_source

data_source_str = get_column_by_name(worksheet, 'data source')[0].value

TypeError: ‘NoneType’ object has no attribute ‘getitem

Any ideas what might be causing the problem? Thanks.

Hi Jared

Are you sure the Excel file you are passing in has a column with the title
’data source’ (not case sensitive but must be otherwise identical)?

··· On 2 February 2016 at 21:40, wrote:

Hello.

I’ve been using the commcare-export tool for some time now and have found
the --dump-query flag to be quite useful. Today I tried using it and am
receiving this set of errors:

commcare-export --project spatialrepellents --query
queries/form_query.xlsx --dump-query > queries/form_query.json

Traceback (most recent call last):

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/bin/commcare-export",
line 9, in

load_entry_point('commcare-export==0.12.2', 'console_scripts',

‘commcare-export’)()

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 197, in entry_point

main(sys.argv[1:])

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 83, in main

main_with_args(args)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 105, in main_with_args

query = excel_query.compile_workbook(workbook)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 200, in compile_workbook

queries.append(compile_sheet(workbook.get_sheet_by_name(sheet)))

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 164, in compile_sheet

source_expr = compile_source(worksheet)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 127, in compile_source

data_source_str = get_column_by_name(worksheet, 'data source')[0].value

TypeError: ‘NoneType’ object has no attribute ‘getitem

Any ideas what might be causing the problem? Thanks.


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa

Simon,

Yes, it does have the ‘data source’ column. I did get it working again
using an older version of the Excel sheet, so I’ll triple check it for
errors. Thanks for your response.

-Jared

··· On Tuesday, February 2, 2016 at 3:20:57 PM UTC-5, skelly wrote: > > Hi Jared > > Are you sure the Excel file you are passing in has a column with the title > 'data source' (not case sensitive but must be otherwise identical)? > > On 2 February 2016 at 21:40, <jol...@nd.edu > wrote: > >> Hello. >> >> I've been using the commcare-export tool for some time now and have found >> the --dump-query flag to be quite useful. Today I tried using it and am >> receiving this set of errors: >> >> commcare-export --project spatialrepellents --query >> queries/form_query.xlsx --dump-query > queries/form_query.json >> >> Traceback (most recent call last): >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/bin/commcare-export", >> line 9, in >> >> load_entry_point('commcare-export==0.12.2', 'console_scripts', >> 'commcare-export')() >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py", >> line 197, in entry_point >> >> main(sys.argv[1:]) >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py", >> line 83, in main >> >> main_with_args(args) >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py", >> line 105, in main_with_args >> >> query = excel_query.compile_workbook(workbook) >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py", >> line 200, in compile_workbook >> >> queries.append(compile_sheet(workbook.get_sheet_by_name(sheet))) >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py", >> line 164, in compile_sheet >> >> source_expr = compile_source(worksheet) >> >> File >> "/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py", >> line 127, in compile_source >> >> data_source_str = get_column_by_name(worksheet, 'data >> source')[0].value >> >> TypeError: 'NoneType' object has no attribute '__getitem__' >> >> >> >> Any ideas what might be causing the problem? Thanks. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "commcare-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Simon Kelly > Senior Engineer | Dimagi South Africa >

If you don’t come right you can send an email to
commcarehq-support@dimagi.com with the file and I’ll have a look.

··· On 2 February 2016 at 23:19, wrote:

Simon,

Yes, it does have the ‘data source’ column. I did get it working again
using an older version of the Excel sheet, so I’ll triple check it for
errors. Thanks for your response.

-Jared

On Tuesday, February 2, 2016 at 3:20:57 PM UTC-5, skelly wrote:

Hi Jared

Are you sure the Excel file you are passing in has a column with the
title ‘data source’ (not case sensitive but must be otherwise identical)?

On 2 February 2016 at 21:40, jol...@nd.edu wrote:

Hello.

I’ve been using the commcare-export tool for some time now and have
found the --dump-query flag to be quite useful. Today I tried using it and
am receiving this set of errors:

commcare-export --project spatialrepellents --query
queries/form_query.xlsx --dump-query > queries/form_query.json

Traceback (most recent call last):

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/bin/commcare-export",
line 9, in

load_entry_point('commcare-export==0.12.2', 'console_scripts',

‘commcare-export’)()

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 197, in entry_point

main(sys.argv[1:])

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 83, in main

main_with_args(args)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/cli.py",
line 105, in main_with_args

query = excel_query.compile_workbook(workbook)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 200, in compile_workbook

queries.append(compile_sheet(workbook.get_sheet_by_name(sheet)))

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 164, in compile_sheet

source_expr = compile_source(worksheet)

File
"/Users/Jared/.virtualenvs/spatial-repellents-web/lib/python2.7/site-packages/commcare_export/excel_query.py",
line 127, in compile_source

data_source_str = get_column_by_name(worksheet, 'data

source’)[0].value

TypeError: ‘NoneType’ object has no attribute ‘getitem

Any ideas what might be causing the problem? Thanks.


You received this message because you are subscribed to the Google
Groups “commcare-users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa