Giter Site home page Giter Site logo

Comments (11)

apulverizer avatar apulverizer commented on June 12, 2024 1

Okay let me see if I can reproduce with my own bash script and project

from workforce-scripts.

jonathancgroves avatar jonathancgroves commented on June 12, 2024

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.

apulverizer avatar apulverizer commented on June 12, 2024

It sounds like your issue is resolved, correct?

from workforce-scripts.

jonathancgroves avatar jonathancgroves commented on June 12, 2024

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.

apulverizer avatar apulverizer commented on June 12, 2024

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.

jonathancgroves avatar jonathancgroves commented on June 12, 2024

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.

apulverizer avatar apulverizer commented on June 12, 2024

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.

jonathancgroves avatar jonathancgroves commented on June 12, 2024

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.

apulverizer avatar apulverizer commented on June 12, 2024

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.

jonathancgroves avatar jonathancgroves commented on June 12, 2024

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.

jonathancgroves avatar jonathancgroves commented on June 12, 2024

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)

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.