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

mapping.forms.FormInfo object does not support updating preserve_field_values_when_hidden #2094

Open
ccone-pattern opened this issue Oct 2, 2024 · 5 comments
Assignees
Labels

Comments

@ccone-pattern
Copy link

ccone-pattern commented Oct 2, 2024

Describe the bug
mapping.forms.FormInfo object does not support updating preserve_field_values_when_hidden when constructed from WebMap.forms.get()

To Reproduce
Steps to reproduce the behavior:
Replace map_id and fls_id with a web map item id and the item id of a feature layer service within the map. Run the following code. Check form settings in FieldMaps Designer and notice nothing has happened.

from arcgis.gis import GIS
from arcgis.mapping import WebMap

gis = GIS("home")
map_id = "your_map_item_id"
fls_id = "your_fls_id"
wm = WebMap(gis.content.get(map_id))
forms = wm.forms
f = forms.get(item_id=fls_id)
f.preserve_field_values_when_hidden = True
f.update()

Screenshots
image
image
image

Expected behavior
I expect the FormInfo object to contain a boolean property that represents the preserveFieldValuesWhenHidden attribute of any FormInfo object in my organization's AGOL environment. I should be able to change this attribute in python and update the form and have those changes reflected in AGOL web interfaces. I should expect the documentation outlined in the arcgis python api reference to reflect source code (docs say this is an attribute, it is not contained in the forms module).

Platform (please complete the following information):

  • OS: Windows
  • Python API Version 2.3.0

Additional context
I am on arcgis version 2.3.0 - I see that 2.4.0 is the latest so this may be a versioning issue, but ArcGIS Pro package manager is not showing me that there is an update available so unable to verify at the moment.
image

@ccone-pattern
Copy link
Author

ccone-pattern commented Oct 2, 2024

After reading through the release notes I see that this is indeed most likely a versioning issue. Seems like great work on the refactor yall - appreciate that we have a content manager within the Map object now and can initialize services from a generic Service class. My guess is that this issue can be closed, but it brings up another one:

Why is this update not exposed in the ArcGIS Pro python package manager? I imagine if I were to update ArcGIS Pro this would populate, but shouldn't we be able to control our arcgis python version independently of ArcGIS Pro?

I don't mind using the ArcPro package manager as along as I can update my packages when needed as soon as releases are available. I could clone the ArcGIS Pro conda envs into a regular conda distro to maintain packages with full functionality, but that is kind of cumbersome and if memory serves, it can mess up the auto-authentication feature that ArcGIS Pro conda provides.

Is there a way users could enable updates to packages within ArcPro without needing to update ArcPro desktop upon every release? Or do you have any other suggestions or resources for maintaining and extending the default arcgis python environment in a standard conda distro with full functionality? I know this is not the proper forum to triage this but I hope you can understand that the current workflow for users to maintain python environments through ArcPro's package manager is pretty awkward at best, and restrictive at worst.

@ccone-pattern
Copy link
Author

ccone-pattern commented Oct 2, 2024

Are the changes made to 2.4.0 live on the package hosted in the esri conda channel? I made a fresh conda environment, installed arcgis=2.4.0, but still seeing the mapping module when I'd expect to see map
image

@ccone-pattern
Copy link
Author

Same thing with pip. pip install arcgis>=2.4.0 using python 3.12 installs the package listed as 2.4.0, but source code is not reflective of what we should see according to change log.

Attached is the pip freeze output from this environment. I can't tell if this is user error or something going on with these distros. Can anyone confirm whether or not they are seeing the latest changes when installing from a fresh pip or conda environment?

requirements.txt
image

@nanaeaubry
Copy link
Contributor

@ccone-pattern Hello, First of all thank you for the nice comments on our update, I am glad that you like the refactoring!

This update was due to jupyter notebooks being upgraded to version 7 and labs to version 4. This required a big effort for Pro and Online/Enterprise Notebooks to refactor their backend for this update. My guess is that this package might not be compatible with versions of Pro less than 3.4 since this new mapping module has not been tested with previous versions of Pro.

This new module is also held in it's own namespace package. If you do conda list arcgis you see there are now two packages: arcgis and arcgis-mapping. I think the fact that you don't see map under arcgis is due to this being another package.

If you have both packages correctly installed then you should be able to do from arcgis.map import Map.

I will pass this note along and see what we can do to make it easier for users to find it

@nanaeaubry nanaeaubry added question and removed bug labels Oct 3, 2024
@nanaeaubry nanaeaubry self-assigned this Oct 3, 2024
@nanaeaubry
Copy link
Contributor

@ccone-pattern After review, if both packages are correctly installed then you should see map show as a suggested namespace under arcgis.
I would check the install process and upgrade to pro 3.4 or use conda to install:
conda install -c esri arcgis arcgis-mapping

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

No branches or pull requests

2 participants