@@ -515,6 +515,13 @@ def _delitem_nosync(self, item):
515
515
raise KeyError (item )
516
516
517
517
def __getattr__ (self , item ):
518
+ # https://github.com/jupyter/notebook/issues/2014
519
+ # Save a possibly expensive lookup (for e.g. against cloud stores)
520
+ # Note: The _ipython_display_ method is required to display the right info as a side-effect.
521
+ # It is simpler to pretend it doesn't exist.
522
+ if item in ["_ipython_canary_method_should_not_exist_" , "_ipython_display_" ]:
523
+ raise AttributeError
524
+
518
525
# allow access to group members via dot notation
519
526
try :
520
527
return self .__getitem__ (item )
@@ -1331,6 +1338,40 @@ def move(self, source, dest):
1331
1338
1332
1339
self ._write_op (self ._move_nosync , source , dest )
1333
1340
1341
+ # Override ipython repr methods, GH1716
1342
+ # https://ipython.readthedocs.io/en/stable/config/integrating.html#custom-methods
1343
+ # " If the methods don’t exist, the standard repr() is used. If a method exists and
1344
+ # returns None, it is treated the same as if it does not exist."
1345
+ def _repr_html_ (self ):
1346
+ return None
1347
+
1348
+ def _repr_latex_ (self ):
1349
+ return None
1350
+
1351
+ def _repr_mimebundle_ (self , ** kwargs ):
1352
+ return None
1353
+
1354
+ def _repr_svg_ (self ):
1355
+ return None
1356
+
1357
+ def _repr_png_ (self ):
1358
+ return None
1359
+
1360
+ def _repr_jpeg_ (self ):
1361
+ return None
1362
+
1363
+ def _repr_markdown_ (self ):
1364
+ return None
1365
+
1366
+ def _repr_javascript_ (self ):
1367
+ return None
1368
+
1369
+ def _repr_pdf_ (self ):
1370
+ return None
1371
+
1372
+ def _repr_json_ (self ):
1373
+ return None
1374
+
1334
1375
1335
1376
def _normalize_store_arg (store , * , storage_options = None , mode = "r" , zarr_version = None ):
1336
1377
if zarr_version is None :
0 commit comments