I have the same problem as Making QGIS layer update from changed data source.
However, I cannot get the solution proposed by Matthias Kuhn in a comment on an answer to that question to work.
I am using QGIS 3.4, I have loaded a .geojson file as a vector layer and am trying to refresh it without removing and re-adding. The map refreshes when I move it but the attribute table is not re-loaded. I may not have understood how to use the reload function so here are my steps, I am using the Python Console.
mc = iface.mapCanvas() layer = mc.currentLayer() layer.name() 'radarOutGJTemp' #--- Correct # Tried the following with errors attached layer.dataProvider().reload() AttributeError: 'QgsVectorDataProvider' object has no attribute 'reload' layer.dataProvider.reload('radarOutGJTemp') AttributeError: 'builtin_function_or_method' object has no attribute 'reload' layer.dataProvider.reload(radarOutGJTemp) AttributeError: 'builtin_function_or_method' object has no attribute 'reload'
I can see the function reload appear in a window as I type. I did try to import reload just in case, that failed but again I could see it appear in the window as I typed.
import reload ModuleNotFoundError: No module named 'reload'