Comments (11)
Okay let me see if I can reproduce with my own bash script and project
from workforce-scripts.
After Googling, I realise this is a UTF 8 Byte Order Mark (see here: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) but I have no idea how it got here.
Jonathan
from workforce-scripts.
It sounds like your issue is resolved, correct?
from workforce-scripts.
Thanks for the speed reply. No, it's not resolved. The BOM is clearly causing the Python script to fail with the keyerror - I don't know where the BOM is coming from though...
from workforce-scripts.
Okay so I can reproduce what you are seeing when I do it the way you are creating the bash variables and passing them to the script.
I made a sample script (omitted extra params for brevity) that works:
#!/bin/bash
source activate arcgis3.6
xField="xField test"
python create_assignments_from_csv.py -csvFile "../uc_data/assignments.csv" -xField "$xField" ...
Can you try this?
from workforce-scripts.
Thanks, Aaron.
I don't understand the source activate arcgis3.6
line, I don't do this...
With the other changes my complete command looked like this (redacted):
sudo python create_assignments_from_csv.py -csvFile "./inputfile.csv" -u "xxx" -p "xxx" -url "https://webgis.xxx.com/arcgis" -pid "xxx" -xField "xField test" -yField "yField" -assignmentTypeField "Type" -locationField "Location" -descriptionField "Description" -priorityField "Prior ity" -workOrderIdField "WorkOrderId" -dispatcherIdField "Dispatcher" -dueDateField "DueDate" -attachmentFileField "attachment" -logFile "./log.txt" -workerField " Worker" -timezone "US/Eastern"
The assignment created:
{'yField': '50.93831389', 'Description': 'Cut 2', 'Due Date': '08/21/2018 23:59:59', '\xef\xbb\xbfxField': '-0.033513889', 'Worker': 'ruralgrass1', 'Work Order Id': 'RUZ7', 'Priority': '3', 'Location': 'Rural Zone 7', 'Type': '2', 'Dispatcher': '1', 'attachment': ''}
So, no change, I'm afraid.
Appreciate your help.
from workforce-scripts.
The source activate arcgis3.6
is just activating a conda virtual environment that has the Python API for ArcGIS installed. It shouldn't affect anything.
I cannot reproduce the issue you see. I copied the commands above and substituted in my fields and works as expected.
Even in the above case when you hard-coded it you are seeing the issue with xField
?
from workforce-scripts.
Oh, thanks. I don't use a virtualenv because I have a dedicated machine.
Yes - I see the same result with the value hard-coded.
But you saw it before, right?
This is going to cause us massive problems, I can't upload the hundreds of Assignments we need for this summer.
Any suggestions gratefully received.
from workforce-scripts.
I could reproduce the initial issue which I think was due to how you are setting the xField
bash variable. But using the sample script here I cannot reproduce it anymore.
I have not seen the error outside of that.
What machine are you running it on? Are you using any other tools in the pipeline, like Jenkins or something (I have seen similar issues when integrating Jenkins/Bash/Python).
Have you tried deleting the entire xField
string/parameter and retyping it (maybe there are hidden characters or something?
from workforce-scripts.
Thanks Aaron.
It's a dedicated headless Raspberry Pi Model 3 - running Debian 4.9.35. Python 2.7, running the ArcGIS Workforce standalone scripts downloaded from this GitHub repo. Nothing exotic in the pipeline. This worked perfectly last year when the Customer was using AGOL - they just moved to an Enterprise on-prem solution earlier this year and I've been working hard to jump through the hoops of making the old solution work again in the Enterprise context..
I did indeed try re-typing the whole line where the xField variable is initialised.
from workforce-scripts.
Aaron, problem solved (thanks so much).
I realised that the extra character was at the very start of my input file, where the column headings are shown. The first column heading was 'xField' and this had somehow picked up this hidden character at the start in editing on my Mac or Windows machine and was invisible on Linux. I did try retyping the xField
string/parameter when you suggested it but only in my bash script - forgetting the other half of the story being the input csv.
Appreciate the time you spent on this.
from workforce-scripts.
Related Issues (20)
- Service name already exists; misreported error, perhaps '&' HOT 3
- How to migrate completed assignments? HOT 1
- Handle_json_error HOT 2
- Type Error: 'NoneType' Object is not subscriptable HOT 1
- Authentication fails when using Enterprise login HOT 4
- Unknown object [OBJ] causes export_assignments_to_csv.py script to fail HOT 3
- Copy assignments does not copy feature service attachments HOT 3
- Will assign assignments based on point features HOT 2
- Exceptions on migrate_assignments.py HOT 2
- AssignmentType shows GUID rather than text Alias in ArcGIS Pro HOT 5
- Assignment Migration - Attachments Failing HOT 3
- Automation needed features HOT 1
- Do scripts work with New WorkForce? HOT 10
- Export assignment to CSV is still using arrow instead of pendulum
- Cannot execute create_assignments_from_csv due to Type error HOT 4
- Can't Assign Work: ValidationError: Assignment must have geometry HOT 4
- assignementread field doesn't exist HOT 1
- Getting KeyError as "assignments" when using workforce with geoprocessing tool. HOT 6
- Not letting worker finish assignment if worker is not nearby assignment HOT 2
- Optimally Creating and Assigning Work Orders Based on Routes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workforce-scripts.